v2026.11.2
All Bundles
Bundle

The SDL2 backend of System.Plot: it draws the same PlotScene the SVG writer does, to a window you can zoom, pan and hover, or to a PNG file. Compile with -lib plot_sdl,plot,sdl2,gen_collect. Saving a PNG needs no window and no display; a window needs one. Not available in the web playground. Design: docs/PLOT_DESIGN.md.

PlotPng

Writes a Figure as a PNG file, on a software surface: no window, no display and no GPU, so it works over SSH and in CI. Text uses the shipped font when it is found.

Operations

Render # function

Renders a scene onto a new ARGB surface; the caller frees it.

function : Render(scene:PlotScene) ~ Surface

Parameters

NameTypeDescription
scenePlotScenewhat to draw

Return

TypeDescription
Surfacethe surface, which IsNull when SDL could not make one

Save # function

Renders a figure to a PNG file at the figure's size.

function : Save(figure:Figure, path:String) ~ Bool

Parameters

NameTypeDescription
figureFigurewhat to draw
pathStringfile to write

Return

TypeDescription
Booltrue when written