ScottPlot
ScottPlot is a free and open-source interactive plotting library for .NET which makes it easy to interactively display data in a variety of formats. You can create interactive line plots, bar charts, scatter plots, etc., with just a few lines of code (see the ScottPlot Cookbook for examples).
In graphical environments plots can be displayed interactively (left-click-drag to pan and right-click-drag to zoom) and in console applications plots can be created and saved as images.
ScottPlot targets multiple frameworks (.NET Framework 4.5 and .NET Core 3.0), has user controls for WinForms and WPF, and is available on NuGet with no dependencies.
Quickstart
This quickstart is for Windows Forms Applications. Similar quickstarts for Console Applications and WPF Applications are in /demos
- Install ScottPlot using NuGet
- Drag/Drop the FormsPlot (from the toolbox) onto your Form
- Add the following code to your startup sequence
double[] xs = new double[] {1, 2, 3, 4, 5};
double[] ys = new double[] {1, 4, 9, 16, 25};
formsPlot1.plt.PlotScatter(xs, ys);
formsPlot1.Render();
You now have a mouse-interactive graph! Left-click-drag to pan, right-click-drag to zoom, and double-click to toggle benchmark display. Check out the ScottPlot Cookbook to see some of the ways graphs can be customized.
Documentation
- ScottPlot Cookbook 🡐 start here
- Project goals and API details are in /doc
- The /demos folder contains:
- Quickstart guides for WinForms, WPF, and Console Applications
- Additional example programs
- Click-to-run compiled demos
Features
Multiple Plot Types
ScottPlot can make scatter plots, box plots, step plots, and even financial plots (candlestick and OHLC plots). The signal plot is a type of scatter plot optimized for speed when plotting evenly-spaced data. Signal plots are capable of displaying tens of millions of data points at >100 Hz framerates allowing comfortable interaction using the mouse. The plot types.exe application (in /demos) demonstrates this.
Animated Plots
If you plot a double array with ScottPlot, later updating the original array automatically updates the data in ScottPlot. The animated sine wave.exe application (in /demos) demonstrates this by plotting an array then uses a timer to update it continuously. Note that the graph is still mouse-interactive (panning and zooming) while continuously updating.
Highspeed Data Visualization
ScottPlot can plot data quickly allowing for high framerates. The audio monitor.exe demo (in /demos) uses two ScottPlot plots to display audio data in real time. The signal (PCM, top) and frequency (FFT, bottom) components are continuously updated at a high framerate and are both mouse-interactive.
Cookbook
The ScottPlot Cookbook is the best way to both see what ScottPlot can do and learn how to use most of the ScottPlot features. Every in /cookbook is shown next to the code used to create it. Here are some samples:
About ScottPlot
ScottPlot was created by Scott Harden (Harden Technologies, LLC) with many contributions from the user community. To inquire about the development special features or customized versions of this software for consumer applications, contact the author at SWHarden@gmail.com.