ScottPlot Documentation

repository·main·Indexed 27 days ago

https://github.com/scottplot/scottplot

A high-performance, open-source .NET plotting library optimized for interactively displaying large datasets. It supports a wide range of platforms including Windows Forms, WPF, Console, Uno Platform, Blazor, Avalonia, Eto, .NET MAUI, WinUI, and .NET Interactive Notebooks.

Tokens
3.1K
Snippets
13
Records
29
Agent score
92%

What's inside ScottPlot

  1. Overview of ScottPlot

    main
    ScottPlot is a free and open-source plotting library for .NET designed to make it easy to interactively display large datasets. It supports a wide variety of environments including Windows Forms, WPF, Console, Uno Platform, Blazor, Avalonia, Eto, and Notebooks.
  2. Quickstart for Windows Forms

    main

    To use ScottPlot in a Windows Forms application:

    1. Install the ScottPlot.WinForms NuGet package.
    2. Drag a FormsPlot control from the Toolbox onto your Form.
    3. Access the Plot property of the control to add data, then call Refresh() to update the display.
    double[] dataX = { 1, 2, 3, 4, 5 };
    double[] dataY = { 1, 4, 9, 16, 25 };
    
    formsPlot1.Plot.Add.Scatter(dataX, dataY);
    formsPlot1.Refresh();
  3. Quickstart with ScottPlot

    main

    To create a basic plot and save it as an image file, instantiate a ScottPlot.Plot object, add data using methods like Add.Scatter, and use SavePng to export the result.

    double[] dataX = { 1, 2, 3, 4, 5 };
    double[] dataY = { 1, 4, 9, 16, 25 };
    
    ScottPlot.Plot myPlot = new();
    myPlot.Add.Scatter(dataX, dataY);
    myPlot.SavePng("quickstart.png", 400, 300);
  4. Use CreateWindow instead of MainPage in .NET 10 MAUI

    main

    In .NET 10 MAUI, the Application.MainPage property is obsolete. To initialize your application's root page, you should override the CreateWindow method instead of using the MainPage setter.

    Old Pattern (Obsolete):

    MainPage = new AppShell();

    New Pattern (.NET 10):

    protected override Window CreateWindow(IActivationState activationState)
    {
        return new Window(new AppShell());
    }