Metabase
Search, query, and visualize Metabase data, all scoped to user permissions.
MEmetabase/metabase51k219 new stars in the last 7 days
Renders MatPlotLibNet charts to PNG, SVG or PDF from a JSON spec an AI agent writes.
MatPlotLibNet is a charting library for C#, .NET 10 and .NET 8, inspired by matplotlib. It draws 91 chart types and saves them as SVG, PNG, PDF or an animated GIF, straight from your server code. It does not need a JavaScript framework, a WebView or a hosted service.
It has a fluent API and it works with dependency injection. It ships with 148 colormaps, 30 themes, 13 map
projections with embedded Natural Earth data, LaTeX-style MathText, text in any script, O(1) streaming (57 of its 59
technical indicators have a streaming form), a control room (Plt.OpsDashboard() — KPI tiles, state timelines, one shared trend window),
and an MCP server so an AI agent can draw with it. Charts render natively in Blazor, WPF, MAUI, Avalonia, Uno and
ASP.NET Core, inside a Verso notebook cell, and TypeScript clients are there for Angular, React and Vue.
| I want to… | Install | First line |
|---|---|---|
| A picture as SVG | dotnet add package MatPlotLibNet | Plt.Create().Plot(x, y).Save("chart.svg") |
| A picture as PNG, PDF or GIF | dotnet add package MatPlotLibNet.Skia | Plt.Create().Plot(x, y).Save("chart.png") |
| A chart in a WPF window | dotnet add package MatPlotLibNet.Wpf | new MplChartControl { Figure = Plt.Create().Plot(x, y).Build() } |
| A chart in an Avalonia window | dotnet add package MatPlotLibNet.Avalonia | <local:MplChartControl Figure="{Binding MyFigure}" /> |
| A chart in a .NET MAUI app | dotnet add package MatPlotLibNet.Maui | <mpl:MplChartView Figure="{Binding ChartFigure}" /> |
| A chart in an Uno Platform app | dotnet add package MatPlotLibNet.Uno | <local:MplChartElement Figure="{x:Bind MyFigure, Mode=OneWay}" /> |
| A chart on a Blazor page | dotnet add package MatPlotLibNet.Blazor | <MplChart Figure="@_figure" CssClass="my-chart" /> |
| A live chart that every viewer sees | dotnet add package MatPlotLibNet.AspNetCore | app.MapChartHub() |
| A chart in a React app | npm install @matplotlibnet/react | <MplChart chartUrl="/api/chart.svg" cssClass="my-chart" /> |
| A chart in a Vue app | npm install @matplotlibnet/vue | <MplChart chartUrl="/api/chart.svg" cssClass="my-chart" /> |
| A chart in an Angular app | npm install @matplotlibnet/angular | <mpl-chart [chartUrl]="'/api/chart.svg'" [cssClass]="'my-chart'"></mpl-chart> |
| A chart in a Verso notebook cell | Verso's Extensions panel | #r "nuget: MatPlotLibNet" |
| A chart in your browser, from a console program | dotnet add package MatPlotLibNet.Interactive | await figure.ShowAsync() |
| Indicators over the columns of a data frame | dotnet add package MatPlotLibNet.DataFrame | new Atr(df.Hlc("high", "low", "close")).Compute() |
| A map | dotnet add package MatPlotLibNet.Geo | ax.Coastlines(GeoProjection.Robinson) |
| A control room of tiles and timelines | dotnet add package MatPlotLibNet | Plt.OpsDashboard() |
| An AI assistant that draws charts | nothing to install, a host runs the tool | dnx MatPlotLibNet.Mcp |
A new project starts from a template: dotnet new install MatPlotLibNet.Templates, then dotnet new mpl-console (a picture as PNG, PDF or GIF), dotnet new mpl-wpf (a chart in a WPF window), dotnet new mpl-blazor (a chart on a Blazor page), dotnet new mpl-blazor-live (a live chart that every viewer sees).
1.32.0 makes the library easier to start with. The top of this page is a table of 17 things you may want to make, each with the
package to install, the first line to write and a link to the page that explains it, and dotnet new install MatPlotLibNet.Templates gives four projects that draw a chart as
they are: a console picture, a WPF window, a Blazor page and a live Blazor page. A chart that draws nothing, or is not wired, says why: every
reason the library speaks has an id from MPL0001 to MPL0028 (listed in the cookbook's Diagnostics page), an indicator short of bars, a
verb that changes the last series when there is none and a series of nothing but NaN are named, and an unmapped hub says
app.MapChartHub(). Save loads MatPlotLibNet.Skia by itself when the program references it, and refuses .jpg and every other
extension no format is written in, where it wrote SVG text under that name. The compiler now warns, in the words the call would be refused
in, at Plot([1.0, 2, 3], [1.0, 2]) and at a Save("chart.png") the program cannot write. Plt.FinanceDashboard(bars) lays out candles,
volume and a panel for each indicator on one time axis, and the volume of the financial template now stands under its candles (it stood up
to 2.2 pixels aside); the time panels of an ops dashboard move together. A live chart whose viewer stops reading no longer holds up the
others: with two viewers and a frame every 20 ms, the viewer that still read received 200 of 200 frames where it received 7, and a publish
to a viewer whose sends take 5 ms returns in 61 us instead of 15 448 us. A country handed out by NaturalEarth110m is a copy, so an edit
reaches no other map, and the publish lists the MCP server in the MCP registry itself.
1.31.1 lets several charts share one page, and one chart its viewers, components and threads. Every figure writes SVG ids of
its own, hashed as matplotlib hashes them, so two charts never clip each other or share a title (RcParamKeys.SvgHashSalt fixes the
salt for SVG that is the same on every run). A chart's script wires only its own chart, a legend click acts on its own plot, two
treemaps or Sankey diagrams in one figure keep apart, and a 3-D plot no longer switches zoom and pan off for the plots beside it. One
module mounts every pushed chart so its scripts run, in Blazor, React, Vue, Angular and the browser popup alike, and a redraw waits
while the reader drags. Live charts that share one client share one connection and keep their updates, a chart registered again
hands over to the new figure, a server keeps a chart only while someone views it, GraphQL subscribers receive what is published, and
a WPF, Avalonia, Uno or MAUI control lets go of what feeds it while it is off screen and answers its first gesture when it is made
interactive after its paint. A style or a font set on another thread is taken whole, a colormap the library ships can no longer be
overwritten by name, and RcParamKeys.SvgFontType (matplotlib's svg.fonttype) keeps the text of an SVG as text. A new suite
opens pages with several charts in a real browser, which is where these bugs showed.
1.31.0 lets you choose what a native chart does with the pointer and the keyboard. The WPF, Avalonia, Uno and MAUI controls take a
ControllerFactory: start from InteractionController.DefaultModifiers, take out the legend toggle or change the zoom and keep the other
gestures, or hand the control a controller of your own (Custom Interaction on the wiki). A control you leave alone behaves as before.
1.30.0 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 copied member, 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 and hands out the markup of every
other one as it was: turning a 3-D surface beside three
panels costs 0.9 to 1.0 ms of CPU a frame in SVG, where it cost 5.1 ms in 1.29.0. Every change reports itself (a property set, an
item added to a list, a value changed in place in an array the figure holds, an interaction, a point a stream appends),
so nothing an application changes is left out of the next picture. Over SignalR a viewer that subscribes with
SubscribeToParts is sent only the parts that changed (one moved panel of seven: 14 % of the document), and nobody is sent
anything when nothing changed; the Blazor, React, Vue and Angular clients do this already. The SVG writer formats its numbers straight into the
document, copies each document once and draws the subplots one after another: a live wall of a trend, a tile row, seven
panels, four log panels and a 3-D surface takes 57 % less CPU per round, and the SVG it writes is the same byte for byte. The
WPF, Avalonia and Uno controls replay every subplot that did not change from a recording of it, the same pixels at any
scale, and every target, from the SVG writer to the native controls, is drawn by one sequence; drawing a figure no longer
writes anything into it, and a voxel chart is now drawn at its opacity. Every public interface can be implemented,
proxied and mocked again, a math label
reads its arguments as TeX does ($a_\alpha$ is a subscript α), a date axis that runs past the year 9999 is drawn
instead of failing, a style (Plt.Style) dresses the figure, the streaming controls raise DataPointClicked, and a
figure shown in the browser is let go of when its handle is disposed. A logit axis spreads probabilities as matplotlib's logit
scale does, where it was drawn as a linear one, and a linked X axis can stand below the plot (WithAddBottomXAxis).
| Package | Install | What it does |
|---|---|---|
| MatPlotLibNet | dotnet add package MatPlotLibNet | Core: models, fluent API, SVG rendering, JSON, transforms |
| MatPlotLibNet.DataFrame | dotnet add package MatPlotLibNet.DataFrame | Microsoft.Data.Analysis.DataFrame extension methods — plot, indicators (SMA/EMA/RSI/MACD/…), and polynomial regression from named columns |
| MatPlotLibNet.Skia | dotnet add package MatPlotLibNet.Skia | PNG, PDF, and animated GIF export via SkiaSharp |
| MatPlotLibNet.Blazor | dotnet add package MatPlotLibNet.Blazor | MplChart + MplLiveChart Razor components with SignalR |
| MatPlotLibNet.AspNetCore | dotnet add package MatPlotLibNet.AspNetCore | REST endpoints, SignalR hub, IChartPublisher |
| MatPlotLibNet.Interactive | dotnet add package MatPlotLibNet.Interactive | figure.ShowAsync() — browser popup, no server needed |
| MatPlotLibNet.GraphQL | dotnet add package MatPlotLibNet.GraphQL | GraphQL queries + subscriptions via HotChocolate |
| MatPlotLibNet.Maui | dotnet add package MatPlotLibNet.Maui | Native MplChartView via Microsoft.Maui.Graphics |
| MatPlotLibNet.Avalonia | dotnet add package MatPlotLibNet.Avalonia | Native MplChartControl for Avalonia 12 — Skia backend, optional local interaction |
| MatPlotLibNet.Uno | dotnet add package MatPlotLibNet.Uno | Native MplChartElement for Uno Platform (WinUI 3 / Android / iOS / macCatalyst) |
| MatPlotLibNet.Wpf | dotnet add package MatPlotLibNet.Wpf | Native WPF MplChartControl via SkiaSharp — all 15 interaction modifiers — and MplStreamingChartControl for live data; your project targets netX.0-windows10.0.19041.0 |
| MatPlotLibNet.Geo | dotnet add package MatPlotLibNet.Geo | 13 map projections, GeoJSON parser, Natural Earth 110m data, geographic polygons |
| MatPlotLibNet.Verso | Verso → Extensions panel | A chart inside a Verso notebook cell, drawn as SVG (cookbook) |
| MatPlotLibNet.Notebooks | #r "nuget: MatPlotLibNet.Notebooks" | Inline SVG in Polyglot / Jupyter notebooks. Microsoft has ended Polyglot Notebooks and .NET Interactive, which this package builds on, so existing notebooks keep working but nothing new is coming — for new work use MatPlotLibNet.Verso |
| MatPlotLibNet.Mcp | dnx MatPlotLibNet.Mcp | MCP server — an AI agent renders charts over stdio (cookbook) |
| MatPlotLibNet.Templates | dotnet new install MatPlotLibNet.Templates | Project templates for dotnet new: mpl-console, mpl-wpf, mpl-blazor and mpl-blazor-live, each a new project that draws a chart |
| @matplotlibnet/angular | npm install @matplotlibnet/angular | Angular components + TypeScript SignalR client |
| @matplotlibnet/react | npm install @matplotlibnet/react | React hooks + components + TypeScript SignalR client |
| @matplotlibnet/vue | npm install @matplotlibnet/vue | Vue 3 composables + TypeScript SignalR client |
| @matplotlibnet/client | installed with each of the three above | The TypeScript SignalR client and SVG mount they share |
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");
91 series types — line, scatter (plain or coloured by point density), bar (plain, stacked, or several groups per category in one call), histogram, pie, box, violin, heatmap, contour, candlestick, OHLC, Point and Figure, treemap, sunburst, icicle, Sankey, chord, word cloud, ternary (scatter and line), Piper, polar, polar heatmap, 3D surface, Bar3D, PlanarBar3D, Line3D, Trisurf3D, Contour3D, Quiver3D, Voxels, Text3D, radar, waffle, waterfall, funnel, gauge, stat tile (single-value KPI), state timeline (discrete state segments over time), pair grid, relative rotation graph, streaming line/scatter/signal/candlestick, and more. On top of them, thirty-eight one-call chart verbs in six families are built from those series, so they add none to the count and travel through JSON as their parts: for data keyed by names Lollipop, Dumbbell, Pareto, SlopeGraph, DotPlot, ParallelCoordinates and Marimekko; for a sample Ridgeline, QQPlot, ProbabilityPlot, KaplanMeier, RiskTable, Raincloud and StemAndLeaf; for x and y arrays BumpChart, ControlChart, ShewhartChart, StreamGraph, Horizon, ConnectedScatter, VLines, HLines, Stairs and Triplot; for the cells of a grid CalendarHeatmap, Spy, MatShow and CalendarEvents; for prices Renko and Kagi; and for a sampled signal Psd, Csd, Cohere, MagnitudeSpectrum, PhaseSpectrum, AngleSpectrum, Acorr and Xcorr.
Signals — Psd, Csd and Cohere estimate a spectrum by Welch's method (one SpectralOptions value holds the sample rate, the segments, the window, the detrend, the padding, the scaling and the sides, its default matplotlib's), MagnitudeSpectrum, PhaseSpectrum and AngleSpectrum take one transform of the whole signal, and Acorr and Xcorr draw a correlation at each lag as stems or as markers. A missing sample leaves out what was worked out from it, never a zero. Spectrogram draws the short-time transform of a signal (Fft.Stft), each frame weighted once by its window and each row at its frequency.
On the figure itself — FigText, FigLegend and FigImage put text, legends for the series of every subplot (outside the axes with room kept by ConstrainedLayout) and an image on the figure rather than in a subplot, in every output, and an inset marks the region it zooms into with IndicateZoom.
Shapes and an axis in another unit — AddPatch puts matplotlib's patches on an axes in data coordinates: a Rectangle, Polygon, Arrow (FancyArrow), Circle, Ellipse, Wedge or Arc, each styled through its own face, edge, dash, hatch and opacity. A patch is drawn through the axes' transform, its curves as matplotlib's Bézier curves with every vertex held to matplotlib's, so it follows a reversed, log or broken axis; it counts in the automatic range, has a row in the legend when it is labelled, and comes back from JSON. Link turns the top X axis or a Y axis past the primary into matplotlib's secondary_xaxis or secondary_yaxis: the primary's range written through an AxisTransform (Linear, Reciprocal, Logarithm, Power or a pair of functions), with each tick where the primary has the value it maps back to. See the cookbook's shapes and linked axes.
MCP server — charts for an AI agent — MatPlotLibNet.Mcp is a
Model Context Protocol server. It ships as a .NET tool that a host starts over
stdio. It has five tools: render_chart (returns a PNG plus a text summary of what was drawn), save_chart
(writes PNG/SVG/PDF to a file and returns the path it wrote), chart_data_table (returns the numbers the picture
is drawn from, as markdown, which an image alone cannot give), list_chart_types and describe_chart_schema. The
spec is the library's own figure JSON, so an agent can ask for anything the library draws. When a spec is wrong,
the server rejects it before rendering and names the wrong field, instead of returning a blank picture. See the
cookbook.
{ "servers": { "MatPlotLibNet.Mcp": { "type": "stdio", "command": "dnx", "args": ["MatPlotLibNet.Mcp", "--yes"] } } }
Control room — Plt.OpsDashboard() builds one operator screen: KPI tiles across the top, state timelines under them, a topology panel showing which service calls which (AddTopology), and a shared trend panel. All of them use one time window that the caller supplies; the library never reads the wall clock. A tile carries a Target, a multi-line Caption that wraps, an inline sparkline, and an OpsCondition saying what it is in. That condition has two axes on purpose: OpsSeverity (normal, warning, critical) is the only one that compares, and OpsVisibility (observed, unknown, shelved) says whether the reading can be believed and whether someone silenced it — a silent source is not a degraded one, and a muted alarm is not a solved problem. OpsCondition.RollUp reads a set of children the way an operator does: the worst child that can be seen decides the colour, the unseen and the muted are counted. WithEventMarker puts a deploy or an incident on every panel that has a clock. Theme.Alarm defines the reserved alarm colours, and four operator backgrounds ship with it. BulletGraphSeries replaces the radial gauge.
Native UI controls — MplChartControl for Avalonia 12 and MplChartElement for Uno Platform render charts natively via SkiaSharp. They need no browser, no WebView and no SignalR. There are 15 interaction modifiers: pan (drag), zoom (scroll), 3D rotation (right-drag), rectangle zoom (Ctrl+drag), brush select (Shift+drag), span select (Alt+drag), legend toggle (click), reset (double-click, Home or Escape), data cursor (click on a point to pin it), the trendline, level and Fibonacci drawing tools, removing a selected drawing (Delete), crosshair (passive) and hover tooltip. The controls also have a toolbar state model, view history (back/forward), tick mirroring, and tight margins. Clicking a data point raises DataPointClicked with the point the reader clicked — series, value, pixel position and axes — so an application can open a detail panel or select a row beside the chart. A server-driven chart reports the same click to its OnDataCursor handler. Home goes back to the view the chart started with, however many zooms and repaints came between. A control's ChartEventHandler takes one IChartEventHandler, the interface a server session takes too, that is told of every gesture, not only the click; the WPF and MAUI controls carry it as well, and on MAUI a finger does what the mouse does (a drag pans, zooms into a rectangle or selects, a pinch zooms, a double tap is Home) once IsInteractive is set.
MathText — LaTeX-like inline math in any label or title: $\alpha^{2}$, $\frac{a}{b}$, $\sqrt{x}$, $\hat{x}$, $\mathbf{F}$, $\mathbb{R}$. It reads the grammar of matplotlib's mathtext (all 634 of its symbol names, its 32 function names, its 23 accents and its 12 spaces) and lays math out as matplotlib does: fractions stacked over a rule, square roots with their bar, scripts raised and nested, limits above and below, delimiters grown to what they enclose, matrices in rows, on every surface.
International text — labels, titles and legend entries in any script. Arabic and Hebrew work with the bundled font: the Unicode bidi algorithm (UAX #9, all 861,948 conformance cases) finds the reading direction, HarfBuzz shapes each run, and the runs are laid out in visual order. SkiaFonts.Register(path) adds a font file for Devanagari, Thai, Chinese and other scripts; the MCP server takes them from MATPLOTLIBNET_FONTS. The same shaping pass produces the text measurement, the SVG glyph outlines and the PNG pixels.
3-D charts — 12 series types: Surface, Wireframe, Scatter3D, Stem3D, Bar3D, PlanarBar3D, Line3D, Trisurf3D (Delaunay), Contour3D (marching squares), Quiver3D (vector field), Voxels (face-culled cubes), Text3D (annotations). The 3-D support includes a full Projection3D pipeline, a DepthQueue3D painter's algorithm, shading from Vec3.FaceNormal plus the Color.Shade/Color.Modulate extension methods, a script for client-side rotation with depth re-sorting (With3DRotation()), camera-derived back faces (CubeFaceSelection: the panes, cube edges, wall grids and tick rows follow the camera at any azimuth, both server-side and during a drag), a configurable Pane3DConfig (floor/wall colors), and 3D colorbar support.
Streaming & Realtime — StreamingLineSeries, StreamingScatterSeries, StreamingSignalSeries and StreamingCandlestickSeries are backed by RingBuffer<T> and add points with AppendPoint(x, y). A RingBuffer<T> is a fixed-capacity circular sequence of any type (64 M appends/s, and it never allocates on append). StreamingFigure provides throttled re-rendering and auto-scaling axes (SlidingWindow, StickyRight, AutoScale). 57 of the 59 indicators have a streaming form, and candles.WithStreaming(axes, indicator) attaches any of them to candlestick data, feeding it the prices and the volume of each bar (the form of each indicator says the same as the batch indicator over every bar so far; FibonacciRetracement and VolumeProfile have none, and StreamingMap says why). Streaming controls exist for WPF, Avalonia, Uno, MAUI, Blazor, and ASP.NET Core. The library includes an SVG diff engine to save bandwidth, and an Rx IObservable<T> adapter.
Geographic projections — the MatPlotLibNet.Geo package has 13 map projections (PlateCarree, Mercator, TransverseMercator, Robinson, Orthographic, LambertConformal, AlbersEqualArea, AzimuthalEquidistant, EqualEarth, Mollweide, Natural Earth, Sinusoidal, Stereographic), a GeoJSON parser and writer, embedded Natural Earth 110m data, and GeoPolygonSeries for coastlines, borders and choropleths. A map axes has one projection that every layer reads, a region with a hole is drawn with the hole, the map comes back whole from JSON (the MCP server draws one from a spec, as geo_polygon), and Points, Bubbles, HexBins, H3Cells, H3Bins, Flows, Cartogram, ContiguousCartogram and Dorling put data on it (H3Cells and H3Bins draw the cells of Uber's H3 index, through a managed port of the H3 library that the package brings with it). A symlog axis scale handles data that spans positive and negative ranges.
Bidirectional SignalR — server-authoritative interactive charts with mutation events (zoom, pan, reset, legend toggle) and notification events (brush-select, hover, the clicked data point). The events form a hierarchy of stacked records, they merge on their own, and the server sends each caller its own hover response.
Accessibility — figure.ToDataTables() gives every chart a data table beside the picture (ToHtml(), ToMarkdown(), ToCsv()). That table is the text alternative that WCAG 1.1.1 requires for a complex image, and an <svg role="img"> cannot provide it on its own. The table is served by MapChartTableEndpoint, by MplChart.ShowDataTable, by the GraphQL chartDataTable field and by the MCP chart_data_table tool, which returns it as markdown to read and as structured values to compute with. The library also has ARIA roles and titles, keyboard navigation, the Okabe-Ito colour-blind-safe palette, the three Petroff accessible colour sequences and a high-contrast theme.
148 colormaps — viridis, plasma, turbo, coolwarm, and 144 more (74 base maps, each with an auto-registered reversed _r variant). The library also has NumPy-style SIMD numerics (Vec, Mat, Linalg, Fft), themes that look like matplotlib's, DataFrame integration with 59 technical indicators, broken axes, and publication-quality SVG/PNG/PDF/GIF export.
MIT — free for any use, open-source or commercial, with no copyleft conditions.
Search, query, and visualize Metabase data, all scoped to user permissions.
MEmetabase/metabase51k219 new stars in the last 7 days
Describe a diagram in a sentence to generate architecture diagrams, select shapes to edit, and undo every change.
DADayuanJiang/next-ai-draw-io37k119 new stars in the last 7 days
Turn any GitHub repo into an interactive architecture diagram, with Mermaid source and a narrated video.
AHahmedkhaleel2004/gitdiagram19k85 new stars in the last 7 days
Give your coding agent access to your Figma data. Implement designs in any framework in one-shot.
GLGLips/Figma-Context-MCP16k56 new stars in the last 7 days
A library of Agent Skills designed to work with the Stitch MCP server. Each skill follows the Agent Skills open standard, for compatibility with coding agents such as Antigravity, Gemini CLI, Claude Code, Cursor.
GOgoogle-labs-code/stitch-skills15k2,572 new stars in the last 7 days
Read Figma designs, replace text in bulk, and propagate component overrides.
GRgrab/cursor-talk-to-figma-mcp7.1k11 new stars in the last 7 days