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.

PlotView

Zoom and pan state for a window, kept apart from SDL so it can be tested without one: how much one mouse-wheel notch zooms, and what a readout says.

Operations

Readout # function

The text a hover shows for a data position.

function : Readout(at:Float[]) ~ String

Parameters

NameTypeDescription
atFloat[x, y] as Axes->DataAt returns it

Return

TypeDescription
Stringfor example "x = 2.5 y = 0.31"

WheelFactor # function

The zoom factor of one mouse-wheel notch: 1.25 in, and the reciprocal out.

function : WheelFactor(notches:Int) ~ Float

Parameters

NameTypeDescription
notchesIntwheel movement, positive zooms in

Return

TypeDescription
Floatthe factor to hand to Axes->Zoom