Skip to content
H.P. Gansevoort edited this page Oct 18, 2026 · 86 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 83 series types, 13 map projections with embedded Natural Earth data, 30 themes, LaTeX-style MathText, O(1) streaming with 58 technical indicators, 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.18.2 is the current release. A state timeline now answers the pointer: hovering a segment names the event and the stretch it covers, clicking it tells your application which segment it was, and a reference line can be moved after it is drawn, which is what a playback marker needs. Dragging now pans a chart that scales itself, which did nothing until the first zoom; a timeline pans and zooms along time only; and stacked charts that share an X axis move together. The WPF chart control also keeps panning and zooming the figure it was last handed, where before it went on acting on the first one, and the package says which Windows version a project has to target to use it. There is a complete WPF example of a replay timeline.

1.18.1 was the release where WPF gained a streaming chart control. MplStreamingChartControl joins the three its siblings already had: bind a StreamingFigure to it once and the chart follows the data, where the ordinary control needed a new figure for every frame because a dependency property only notices a changed reference. The same release makes StreamingFigure.MinRenderInterval mean what it says — the clock behind it was started once when the figure was built, so asking for a calmer chart quietly kept giving you thirty frames a second — and a clustermap draws the row and column labels it is given, each beside the row or column it names.

1.18.0 brought charts inside a Verso notebook cell. Verso is the open-source notebook built to replace Polyglot Notebooks, and MatPlotLibNet.Verso is an extension you install from its Extensions panel: after that, a cell that ends on a figure — or on the builder that makes one, without .Build() — shows the chart instead of a line of type names. A chart fills the width of the cell, and one taller than the cell can show gets a scroll box rather than being squeezed into a size nobody chose. The package carries the extension and nothing else, because a notebook loads an extension in its own context and a second copy of the charting library there would be a different Figure from the cell's. MatPlotLibNet.Notebooks stands still at the version it reached — the runtime under Polyglot Notebooks has ended — and notebook work belongs in Verso now.

NuGet · Changelog · License: MIT

dotnet add package MatPlotLibNet
Plt.Create()
   .AddSubPlot(1, 1, 1, ax => ax.Plot(x, y, s => s.Label = "signal"))
   .SaveSvg("chart.svg");

Start here

Page For
Getting Started install, first chart, output formats, subplots
Fluent Cheatsheet one page: Plt · FigureBuilder · AxesBuilder
Chart Types all 83 series with code — including the control room
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 where it is going, how to help

Also: Playground · From matplotlib to C# · Cookbook · 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 (SkiaSharp or Microsoft.Maui.Graphics), pan / zoom / brush-select, no WebView
Data scientist inline SVG in notebooks, plotting straight from Microsoft.Data.Analysis.DataFrame
Trading / finance candlestick, OHLC, 58 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. That is currently 706 classes at 99.6 % line and 97.5 % branch coverage, across 11,757 tests. Rendering is verified against matplotlib pixel-fidelity fixtures.

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

Clone this wiki locally