v2026.11.2
All Bundles
Bundle

A matplotlib-like plotting library: scatter, histogram, line and bar charts, subplots, as standalone SVG. A Figure holds one or more Axes; drawing the figure builds a PlotScene, an ordered list of pixel-space drawing primitives (lines, polylines, polygons, rects, circles, text), and a backend turns the scene into output. The SVG backend writes SVG 1.1 with no script and no external font, one decimal for every coordinate, so the same data gives the same bytes on every platform. Compile with -lib plot,gen_collect; it needs nothing else and draws without a display. Design: docs/PLOT_DESIGN.md. Examples: docs/AI.md, "Plotting".

PlotNote

A reference line or text laid over an Axes, positioned in data coordinates.

Operations

GetText #

The string.

method : public : GetText() ~ String

Return

TypeDescription
Stringthe text, empty for a line

GetX1 #

First x.

method : public : GetX1() ~ Float

Return

TypeDescription
Floatx

GetX2 #

Second x.

method : public : GetX2() ~ Float

Return

TypeDescription
Floatx

GetY1 #

First y.

method : public : GetY1() ~ Float

Return

TypeDescription
Floaty

GetY2 #

Second y.

method : public : GetY2() ~ Float

Return

TypeDescription
Floaty

HasArrow #

Whether the text points at a position with a line.

method : public : HasArrow() ~ Bool

Return

TypeDescription
Booltrue for an annotation

IsLine #

Whether this is a reference line.

method : public : IsLine() ~ Bool

Return

TypeDescription
Booltrue for a line

New # constructor

Constructor

New(is_line:Bool, x1:Float, y1:Float, x2:Float, y2:Float, text:String, arrow:Bool)

Parameters

NameTypeDescription
is_lineBooltrue for a reference line from (x1, y1) to (x2, y2); false for text
x1Floatfirst x, or the point a text or annotation refers to
y1Floatfirst y
x2Floatsecond x, or where an annotation's text sits
y2Floatsecond y
textStringthe string, or empty for a line
arrowBooltrue for an annotation: text at (x2, y2) with a line to the point (x1, y1)