ScottPlot is a free and open-source library for data visualization and chart creation in .NET.
With ScottPlot we can create all kinds of high-quality charts with little effort and minimal code.
We can create line charts, bar charts, pie charts, scatter plots, bubble charts, gauges, and many others.
Furthermore, as expected, we can customize a wide range of options, from axes, colors, font sizes, legends, to data labels.
ScottPlot is compatible with NET6, making it compatible with Windows, Linux, and macOS, and we can use it in WinForms, WPF, Console, Avalonia, PowerShell projects, among others.
How to Use ScottPlot
We can easily add the library to a .NET project through the corresponding Nuget package.
Install-Package ScottPlot
Now we can create our charts easily. For example, the following code creates a scatter plot and saves the image as a png.
double[] xs = new double[] {1, 2, 3, 4, 5};
double[] ys = new double[] {1, 4, 9, 16, 25};
var plt = new ScottPlot.Plot(400, 300);
plt.AddScatter(xs, ys);
plt.SaveFig("scatter_chart.png");
While the following would generate a simple bar chart.
double[] values = { 26, 20, 23, 7, 16 };
var plt = new ScottPlot.Plot(600, 400);
plt.AddBar(values);
plt.SetAxisLimits(yMin: 0);
plt.SaveFig("bar_chart.png");
There are many more types of examples and options we can adjust. Fortunately, documentation and examples are one of ScottPlot’s strongest points.
You have a ton of examples for both chart types and customization options in the Cookbook ScottPlot 4.1 Cookbook.
ScottPlot is Open Source, and all its code is available on GitHub - ScottPlot/ScottPlot: Interactive plotting library for .NET

