MatPlotLibNet.Skia 1.23.0

dotnet add package MatPlotLibNet.Skia --version 1.23.0
                    
NuGet\Install-Package MatPlotLibNet.Skia -Version 1.23.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MatPlotLibNet.Skia" Version="1.23.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MatPlotLibNet.Skia" Version="1.23.0" />
                    
Directory.Packages.props
<PackageReference Include="MatPlotLibNet.Skia" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MatPlotLibNet.Skia --version 1.23.0
                    
#r "nuget: MatPlotLibNet.Skia, 1.23.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MatPlotLibNet.Skia@1.23.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MatPlotLibNet.Skia&version=1.23.0
                    
Install as a Cake Addin
#tool nuget:?package=MatPlotLibNet.Skia&version=1.23.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.23.0 66 10/27/2026
1.22.0 165 10/24/2026
1.21.0 137 10/23/2026
1.20.0 147 10/22/2026
1.19.0 148 10/21/2026
1.18.2 143 10/18/2026
1.18.1 144 10/12/2026
1.18.0 183 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
1.12.0 186 6/30/2026
Loading failed

MatPlotLibNet 1.23.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#1230