Repository navigation
Notebooks
⚠ Microsoft has ended Polyglot Notebooks and will archive .NET Interactive.
MatPlotLibNet.Notebooksbuilds on .NET Interactive. Existing setups keep working, but the package stands still at the version it reached and nothing builds or publishes it any more. For new notebook work see Verso.
MatPlotLibNet.Verso draws the same charts in a Verso notebook, the open-source notebook built to replace Polyglot. Install the extension from Verso's Extensions panel and a cell that ends on a figure shows the chart. See Verso for the whole page.
If what you want is a chart outside a notebook, MatPlotLibNet.Interactive opens a live browser window from any .NET context: a console app, a script, a test or a background service. It needs no notebook runtime, no kernel and no web server.
dotnet add package MatPlotLibNet.Interactiveusing MatPlotLibNet;
using MatPlotLibNet.Interactive;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
var figure = Plt.Create()
.WithTitle("My Chart")
.Plot(x, y)
.Build();
// Opens a browser window — equivalent to a notebook cell output
var handle = await figure.ShowAsync();
// Change the figure and push the new frame — like re-running a cell
figure.Title = "My Chart, recalculated";
figure.SubPlots[0].Plot(x, y.Select(value => value * 2).ToArray());
await handle.UpdateAsync();Which one to reach for:
| Polyglot Notebooks | Verso | MatPlotLibNet.Interactive | |
|---|---|---|---|
| Runtime dependency | .NET Interactive (EOL) | Verso | None |
| Charts inline in a cell | Yes | Yes | No |
| Works in console / scripts | No | No | Yes |
| Works in unit tests | No | No | Yes |
| Live push updates | No | No | Yes (SignalR) |
| Still developed | No | Yes | Yes |
See the Package Map for full details.
Existing Polyglot Notebooks setups keep working as before:
#r "nuget: MatPlotLibNet.Notebooks"using MatPlotLibNet;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
// Return a Figure — displayed inline automatically
Plt.Create().WithTitle("My Chart").Plot(x, y).Build()double[] y1 = [2, 4, 3, 5, 1];
double[] y2 = [1, 3, 5, 4, 2];
// Explicit display — multiple charts in one cell
Plt.Create().Plot(x, y1).WithTitle("A").Build().Display();
Plt.Create().Plot(x, y2).WithTitle("B").Build().Display();The package places its DLL in interactive-extensions/dotnet so Polyglot Notebooks auto-discovers it as a kernel extension. On load it registers a Formatter<Figure> with MIME type text/html:
Figure → figure.ToSvg() → <div style="overflow:auto;max-width:100%;">{svg}</div>
This is Microsoft's own migration guidance: use the VS Code Jupyter extension with an alternative Jupyter kernel. Save the SVG to a file and reference it from a Markdown cell:
using MatPlotLibNet;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
Plt.Create().Plot(x, y).Save("chart.svg");
// In a Markdown cell: This is the simplest fallback for scripts. It has no runtime dependency at all:
using MatPlotLibNet;
using MatPlotLibNet.Skia;
double[] x = [1, 2, 3, 4, 5];
double[] y = [2, 4, 3, 5, 1];
Plt.Create().Plot(x, y).Save("chart.svg"); // open in any browser
File.WriteAllBytes("chart.png", Plt.Create().Plot(x, y).Build().ToPng()); // needs MatPlotLibNet.Skia| Target framework | net8.0 |
| Key dependency |
Microsoft.DotNet.Interactive (private, not transitive) |
| Status | Frozen at the version it reached. Nothing builds it and nothing publishes it; the upstream runtime is EOL |
| Replacement |
MatPlotLibNet.Verso for a notebook, MatPlotLibNet.Interactive outside one |
MatPlotLibNet 1.30.0
- Home
- Getting Started
- Fluent Cheatsheet
- Examples — each release in code
- Migrating to 1.30.0 — what was removed and what takes its place
-
Package Map
- MatPlotLibNet — the core package
- Chart Types
- Styling
- Advanced
- Streaming
- Bidirectional SignalR
- Interactive Controls
- MCP Server
- Verso
- Notebooks
- Accessibility
- International Text
- Benchmarks
- Roadmap
- Contributing
On the docs site
- Playground — try a chart in the browser
- Cookbook — copy-paste code with its picture
- API reference — every public type and member