MatPlotLibNet — matplotlib for .NET
A charting library for C#, .NET 10 and .NET 8. It draws 83 chart types and saves them as SVG, PNG, PDF or an animated GIF, straight from your server code. It comes with 148 colormaps, 13 map projections, 30 themes, streaming, an MCP server for AI agents, and native controls for Blazor, WPF, MAUI, Avalonia and Uno. It comes as 15 NuGet packages, and it needs no JavaScript framework, no WebView and no hosted service.
Beyond the 83 chart types, 17 chart verbs draw whole charts from your data in one call, such as a Pareto chart, a ridgeline, a calendar heatmap, a control chart or a Kaplan-Meier curve. A verb adds no chart type of its own: it is built from series the library already has, so the figure still goes through JSON, the MCP server and the native controls.
Quick start
using MatPlotLibNet;
using MatPlotLibNet.Styling;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
Plt.Create()
.WithTitle("My First Chart")
.WithTheme(Theme.Dark)
.AddSubPlot(1, 1, 1, ax => ax
.Plot(x, y, s => { s.Color = Colors.Blue; s.Label = "Data"; })
.WithLegend())
.Save("chart.svg");
Explore
| Section | Description |
|---|---|
| From matplotlib to C# | Know plt.plot and plt.subplots? This is the same table in C#, call by call. |
| Playground | Try charts live in the browser. Pick an example, change it and see the SVG update. |
| Cookbook | Code examples with rendered images. Copy the code, paste it, and you get the chart. |
| API Reference | Full API documentation generated from XML doc comments |
| Wiki | Guides, tutorials, and architecture documentation |
| NuGet | Install via dotnet add package MatPlotLibNet |
Packages
| Package | Purpose |
|---|---|
MatPlotLibNet |
Core: models, fluent API, SVG rendering |
MatPlotLibNet.Skia |
PNG, PDF, GIF export via SkiaSharp |
MatPlotLibNet.Blazor |
Razor components with SignalR |
MatPlotLibNet.AspNetCore |
REST, a SignalR hub and IChartPublisher |
MatPlotLibNet.Interactive |
Browser popup — no server needed |
MatPlotLibNet.GraphQL |
HotChocolate queries and subscriptions |
MatPlotLibNet.Maui |
Native MAUI control |
MatPlotLibNet.Avalonia |
Native Avalonia 12 control |
MatPlotLibNet.Uno |
Native Uno Platform control |
MatPlotLibNet.DataFrame |
DataFrame indicators and regression |
MatPlotLibNet.Wpf |
Native WPF chart control via SkiaSharp |
MatPlotLibNet.Geo |
13 map projections, GeoJSON, Natural Earth 110m data |
MatPlotLibNet.Mcp |
MCP server that provides charts for an AI agent |
MatPlotLibNet.Verso |
Charts inside a Verso notebook cell, drawn as SVG |
MatPlotLibNet.Notebooks |
Inline SVG in Polyglot or Jupyter notebooks. Microsoft has ended the runtime underneath it, so existing notebooks keep working and new work belongs in MatPlotLibNet.Verso |