MatPlotLibNet.WinForms 1.32.0

dotnet add package MatPlotLibNet.WinForms --version 1.32.0
                    
NuGet\Install-Package MatPlotLibNet.WinForms -Version 1.32.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MatPlotLibNet.WinForms" Version="1.32.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MatPlotLibNet.WinForms" Version="1.32.0" />
                    
Directory.Packages.props
<PackageReference Include="MatPlotLibNet.WinForms" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MatPlotLibNet.WinForms --version 1.32.0
                    
#r "nuget: MatPlotLibNet.WinForms, 1.32.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MatPlotLibNet.WinForms@1.32.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MatPlotLibNet.WinForms&version=1.32.0
                    
Install as a Cake Addin
#tool nuget:?package=MatPlotLibNet.WinForms&version=1.32.0
                    
Install as a Cake Tool

MatPlotLibNet.WinForms

A chart in a Windows Forms window. You put one control on a form and hand it a figure; with IsInteractive the reader can zoom with the wheel, pan with a drag, turn a 3-D chart and select a region in the units of the data. It draws natively with SkiaSharp: no WebView, no browser.

Start a form with a chart

To add a chart to a Windows Forms project you have, three steps.

1. Add the packages. MatPlotLibNet draws the figure and this package shows it:

dotnet add package MatPlotLibNet
dotnet add package MatPlotLibNet.WinForms

The project must target Windows 10 version 2004 or later (net10.0-windows10.0.19041.0), because the SkiaSharp view for Windows Forms does.

2. Put the control on the form. In the form's constructor, after the line that loads the form, make the control:

var chart = new MplChartControl { IsInteractive = true };

Then add it to the form's Controls, like any other control, and set its Dock property to Fill if it should fill the form.

3. Give it a figure. Build the figure and set it on the control:

double[] x = [0, 1, 2, 3, 4, 5, 6];
double[] y = [0, 1, 4, 9, 16, 25, 36];
chart.Figure = Plt.Create().WithTitle("Squares").Plot(x, y).Build();

Run it and the form shows the squares of 0 to 6 as a line:

A line chart titled Squares, climbing from 0 at the left to 36 at the right

Give the control another figure at any time and it draws that one; the pan and zoom follow the new figure. You can also drop MplChartControl on a form in the designer and set its Figure in code.

A chart that keeps changing

MplStreamingChartControl follows a StreamingFigure and draws it again as data arrives, so the figure stays the same object for the life of the chart. WinFormsAnimationTimer ticks on the UI thread, which is what an animation needs to draw on a form.

A chart whose gestures a server decides

WithServerInteraction(send) sends each gesture to a server instead of applying it here; whoever receives it applies it.

Where next

  • Line charts: every way to draw a line, with the pictures.
  • Package map: what each of the packages does.
  • The same control for WPF.
  • It is Windows only, like the WPF package.
Product Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.32.0 55 12/3/2026

MatPlotLibNet 1.32.0. What changed in this release, and in every release before it, is written out in the changelog: https://github.com/xkqg/MatPlotLibNet/blob/main/CHANGELOG.md#1320