Skip to content
H.P. Gansevoort edited this page Nov 27, 2026 · 97 revisions

MatPlotLibNet Wiki

Matplotlib-inspired charting for .NET. MatPlotLibNet renders charts on the server as SVG, PNG, PDF or animated GIF. It ships an MCP server, so an AI agent can render charts with it. It has 91 series types, thirty-eight charts built from them in one call, 13 map projections with embedded Natural Earth data, 30 themes, LaTeX-style MathText, O(1) streaming (57 of its 59 technical indicators have a streaming form), a control room (Plt.OpsDashboard(): KPI tiles, state timelines, a service-topology panel and one shared trend window), and native controls for Blazor, WPF, MAUI, Avalonia, Uno and ASP.NET Core. The API is fluent and works with dependency injection. There is no JavaScript framework, no WebView and no SaaS.

1.30.0 is the current release. It cleans up, speeds up and makes the library object-oriented again. The releases before it added verbs, themes, legends, maps and indicators faster than the structure under them grew; now each rule has one owner that every reader asks, what differs between two themes or two kinds of series is a value and not a member copied into each class, and each step was measured before and after by the processor time of the process (an axis with breaks maps its points 13 times faster, a force-directed graph lays itself out 4 to 5 times faster, and nothing measured takes more CPU than in 1.29.0 beyond the spread of the measurement apart from the parse of a label that holds math, which now builds the boxes matplotlib's layout places). The speed is greatest in a live chart, which redraws only what changed: a figure drawn again draws only the axes that changed since its last draw, a round of a live wall takes 57 % less CPU, a 3-D surface turned beside three panels costs 0.9 to 1.0 ms of CPU a frame in SVG where it cost 5.1 ms, and over SignalR a viewer that subscribes with SubscribeToParts is sent only the parts that changed. Every change to a figure reports itself, a style (Plt.Style) now dresses the figure, a math label reads its arguments as TeX does, and the matplotlib themes measure text and pad a tight layout as matplotlib 3.11 does. Every new call is shown in code on the examples page.

Every earlier release is summed up in one row of the table at the top of the examples page, each with the code it added, and in full in the changelog. Code written against 1.29.0 builds again after a recompile, except for a call to one of the members 1.30.0 removed: Migrating to 1.30.0 names each of them and what takes its place.

NuGet · Changelog · License: MIT

dotnet add package MatPlotLibNet
using MatPlotLibNet;

double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];

Plt.Create()
   .AddSubPlot(1, 1, 1, ax => ax.Plot(x, y, s => s.Label = "signal"))
   .Save("chart.svg");

Start here

Page For
Getting Started install, first chart, output formats, subplots
Fluent Cheatsheet one page: Plt · FigureBuilder · AxesBuilder
Examples what each release added, in code that compiles
Migrating to 1.30.0 what 1.30.0 removed, and what takes its place
Chart Types all 91 series with code — including the control room and the charts in one call
Package Map which of the 14 NuGet + 3 npm packages you need
Styling · MatplotlibThemes themes, colours, fonts, layout
Advanced animation, geo projections, MathText, DI
Streaming live data, O(1) ring buffers, indicators
Bidirectional SignalR push charts to Blazor / Angular / React / Vue
Interactive Controls · Keyboard Shortcuts pan, zoom, brush-select, hotkeys
Notebooks Polyglot / Jupyter
Accessibility The data table beside the chart, ARIA, contrast, screen readers
Benchmarks render and export timings
Roadmap · Contributing what is done and what is still to come, how to help

Also: Playground · From matplotlib to C# · Cookbook · A replay timeline in WPF · API Reference.

Who it is for

You are… You get…
Blazor / ASP.NET Core <MplChart> and <MplLiveChart>, SignalR push, a REST endpoint — wired with standard DI
WPF / MAUI / Avalonia / Uno native controls, no WebView: the WPF, Avalonia and Uno controls draw through SkiaSharp and the MAUI view through Microsoft.Maui.Graphics, and all four pan, zoom and brush-select, by mouse or by finger
Data scientist inline SVG in notebooks, plotting straight from Microsoft.Data.Analysis.DataFrame
Trading / finance candlestick, OHLC, 59 indicators, drawing tools, backtest panels, RRG
Ops / control room Plt.OpsDashboard() — KPI tiles, state timelines, a service-topology panel, one shared trend window
Backend / headless render SVG, PNG, PDF or GIF server-side with zero UI dependencies
Angular / React / Vue TypeScript clients on the same hub and the same chart definitions

What it is not

MatPlotLibNet is not a JavaScript wrapper, not a WebView host and not a hosted service. Charts are built and rendered in .NET. Only a picture or a chart definition leaves the process.

Quality bar

Every class passes a strict per-class coverage gate of at least 90 % line and branch coverage, and a separate fidelity suite compares rendering with images drawn by matplotlib; both run in CI.

If you have a question or something is missing, open a Discussion or an Issue. Releases follow what people actually need.

MatPlotLibNet 1.30.0

On the docs site

Clone this wiki locally