MatPlotLibNet.Skia
1.20.0
See the version list below for details.
dotnet add package MatPlotLibNet.Skia --version 1.20.0
NuGet\Install-Package MatPlotLibNet.Skia -Version 1.20.0
<PackageReference Include="MatPlotLibNet.Skia" Version="1.20.0" />
<PackageVersion Include="MatPlotLibNet.Skia" Version="1.20.0" />
<PackageReference Include="MatPlotLibNet.Skia" />
paket add MatPlotLibNet.Skia --version 1.20.0
#r "nuget: MatPlotLibNet.Skia, 1.20.0"
#:package MatPlotLibNet.Skia@1.20.0
#addin nuget:?package=MatPlotLibNet.Skia&version=1.20.0
#tool nuget:?package=MatPlotLibNet.Skia&version=1.20.0
MatPlotLibNet.Skia
PNG and PDF export for the MatPlotLibNet charting library using SkiaSharp.
Installation
dotnet add package MatPlotLibNet.Skia
Usage
using MatPlotLibNet;
using MatPlotLibNet.Transforms;
var figure = Plt.Create()
.WithTitle("My Chart")
.Plot([1, 2, 3, 4, 5], [2, 4, 3, 5, 1])
.Build();
// Export as PNG
figure.Transform(new PngTransform()).ToFile("chart.png");
// Export as PDF
figure.Transform(new PdfTransform()).ToFile("chart.pdf");
// Export to stream
using var stream = new MemoryStream();
figure.Transform(new PngTransform()).ToStream(stream);
// Export to byte array
byte[] bytes = figure.Transform(new PdfTransform()).ToBytes();
Resolution, title and author
A figure is laid out in units of one pixel at 96 dpi, and a PNG is drawn with dpi / 96 pixels for each unit. A figure
given WithDpi(192) saves as a PNG twice as wide and twice as tall as its size, with the same layout, text and line
widths, drawn finer: 500 by 350 becomes 1000 by 700 pixels. The pixel count is rounded to a whole number (800 by 600 at
150 dpi is 1250 by 938), and a dpi that is not positive is refused. The frames of an animated GIF follow their figure's
dpi the same way.
SaveOptions set the resolution, the title and the author for one save, whatever the figure holds:
figure.Save("chart.png", new SaveOptions { Dpi = 300, Title = "Revenue", Author = "Finance" });
figure.Save("chart.pdf", new SaveOptions { Title = "Revenue", Author = "Finance" });
A PNG keeps the title and the author as text chunks with the keywords Title and Author. A PDF keeps them in its
document information. A Dpi other than 96 replaces the figure's own resolution for that save. A PDF page is a vector
drawing, one point to a unit, so the dpi changes nothing in a PDF (nor in an SVG).
Text and fonts
Text is shaped with HarfBuzz. Arabic letters join, Hebrew reads right to left, Latin pairs are kerned, and a label that mixes scripts is laid out in reading order. The font that ships in the package, DejaVu Sans, covers Latin, Greek, Cyrillic, Arabic and Hebrew.
For other scripts, register a font file once at startup and use its family name:
var font = SkiaFonts.Register("fonts/NotoSansDevanagari-Regular.ttf");
var theme = Theme.CreateFrom(Theme.Seaborn).WithFont(f => f with { Family = font.Family }).Build();
A font installed on the machine can be used by its family name without registering it. When a family cannot be
found anywhere, the chart falls back to the operating system's default face and reports the fallback once through
ChartDiagnostics.Emitted.
License
MIT -- Copyright (c) 2026 H.P. Gansevoort
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- MatPlotLibNet (>= 1.20.0)
- SkiaSharp (>= 3.119.4)
- SkiaSharp.HarfBuzz (>= 3.119.4)
-
net8.0
- MatPlotLibNet (>= 1.20.0)
- SkiaSharp (>= 3.119.4)
- SkiaSharp.HarfBuzz (>= 3.119.4)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on MatPlotLibNet.Skia:
| Package | Downloads |
|---|---|
|
MatPlotLibNet.Uno
Uno Platform chart control for MatPlotLibNet. Renders charts natively via SkiaSharp with optional pan/zoom/reset interaction. |
|
|
MatPlotLibNet.Avalonia
Avalonia 12 chart control for MatPlotLibNet. Renders charts natively via SkiaSharp with optional pan/zoom/reset/brush-select interaction. |
|
|
MatPlotLibNet.Wpf
WPF chart control for MatPlotLibNet. Renders charts natively via SkiaSharp with optional pan/zoom/3D rotation interaction. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.24.0 | 0 | 10/29/2026 |
| 1.23.0 | 76 | 10/27/2026 |
| 1.22.0 | 166 | 10/24/2026 |
| 1.21.0 | 138 | 10/23/2026 |
| 1.20.0 | 147 | 10/22/2026 |
| 1.19.0 | 149 | 10/21/2026 |
| 1.18.2 | 144 | 10/18/2026 |
| 1.18.1 | 144 | 10/12/2026 |
| 1.18.0 | 189 | 9/23/2026 |
| 1.17.1 | 158 | 9/13/2026 |
| 1.17.0 | 163 | 9/12/2026 |
| 1.16.0 | 150 | 9/12/2026 |
| 1.15.1 | 159 | 9/12/2026 |
| 1.15.0 | 154 | 9/11/2026 |
| 1.14.4 | 154 | 9/11/2026 |
| 1.14.3 | 150 | 8/30/2026 |
| 1.14.2 | 305 | 8/17/2026 |
| 1.14.1 | 171 | 8/15/2026 |
| 1.14.0 | 200 | 7/12/2026 |
| 1.13.0 | 182 | 7/4/2026 |
MatPlotLibNet 1.20.0. What changed in this release, and in every release before it, is written out in the changelog: https://github.com/xkqg/MatPlotLibNet/blob/main/CHANGELOG.md#1200