ScottPlot.NET
GitHub Repo stars

WPF Quickstart

Step 1: Install the ScottPlot.WPF NuGet package

Step 2: Add this to the root element of your XAML file:

xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"

Step 3: Add a WpfPlot to your layout and give it a unique name

<ScottPlot:WpfPlot x:Name="WpfPlot1" />

Step 4: Plot some data in your start-up sequence

double[] dataX = { 1, 2, 3, 4, 5 };
double[] dataY = { 1, 4, 9, 16, 25 };
WpfPlot1.Plot.Add.Scatter(dataX, dataY);
WpfPlot1.Refresh();

Startup in .NET Framework Apps

Projects targeting .NET Framework should setup their plot inside the Loaded event.

public MainWindow()
{
    InitializeComponent();

    Loaded += (s, e) =>
    {
        double[] dataX = { 1, 2, 3, 4, 5 };
        double[] dataY = { 1, 4, 9, 16, 25 };
        WpfPlot1.Plot.Add.Scatter(dataX, dataY);
        WpfPlot1.Refresh();
    };
}