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".

Artist

One drawn thing on an Axes: its kind, legend name and data. Axes builds these.

Operations

GetColNames #

Column labels of a heatmap.

method : public : GetColNames() ~ String[]

Return

TypeDescription
Stringthe labels, or Nil

GetColors #

Color-scale values.

method : public : GetColors() ~ Float[]

Return

TypeDescription
Floatone per point, or Nil

GetCols #

Columns of a heatmap.

method : public : GetCols() ~ Int

Return

TypeDescription
Intthe count, 0 for anything else

GetDecimals #

Decimals of the printed heatmap values.

method : public : GetDecimals() ~ Int

Return

TypeDescription
Intthe count

GetEdges #

Histogram bin edges.

method : public : GetEdges() ~ Float[]

Return

TypeDescription
Floatthe edges, or Nil

GetKind #

What it draws.

method : public : GetKind() ~ ArtistKind

Return

TypeDescription
ArtistKindthe kind

GetName #

Legend entry.

method : public : GetName() ~ String

Return

TypeDescription
Stringthe name, possibly empty

GetOutliers #

Box plot values beyond the whiskers.

method : public : GetOutliers() ~ Float[]

Return

TypeDescription
Floatthe outliers, or Nil

GetRowNames #

Row labels of a heatmap, top to bottom.

method : public : GetRowNames() ~ String[]

Return

TypeDescription
Stringthe labels, or Nil

GetRows #

Rows of a heatmap.

method : public : GetRows() ~ Int

Return

TypeDescription
Intthe count, 0 for anything else

GetSizes #

Size values.

method : public : GetSizes() ~ Float[]

Return

TypeDescription
Floatone per point, or Nil

GetStats #

Box plot statistics.

method : public : GetStats() ~ Float[]

Return

TypeDescription
Float[position, low whisker, first quartile, median, third quartile, high whisker], or Nil

GetXs #

x values.

method : public : GetXs() ~ Float[]

Return

TypeDescription
Floatthe values

GetYs #

y values.

method : public : GetYs() ~ Float[]

Return

TypeDescription
Floatthe values

IsAnnotated #

Whether a heatmap prints its values.

method : public : IsAnnotated() ~ Bool

Return

TypeDescription
Booltrue when annotated

New # constructor

Constructor for a heatmap.

New(name:String, values:Float[], rows:Int, cols:Int, row_names:String[], col_names:String[], annotate:Bool, decimals:Int)

Parameters

NameTypeDescription
nameStringlegend entry, or empty
valuesFloatthe cells, row by row
rowsIntnumber of rows
colsIntnumber of columns
row_namesStringone label per row, top to bottom
col_namesStringone label per column
annotateBooltrue to print each value in its cell
decimalsIntdecimals in the printed values

New # constructor

Constructor for a box plot.

New(name:String, values:Float[], stats:Float[], outliers:Float[])

Parameters

NameTypeDescription
nameStringthe category label under the box
valuesFloatthe data
statsFloat[position, low whisker, first quartile, median, third quartile, high whisker]
outliersFloatthe values beyond the whiskers, possibly empty

New # constructor

Constructor

New(kind:ArtistKind, name:String, xs:Float[], ys:Float[], colors:Float[], sizes:Float[], edges:Float[])

Parameters

NameTypeDescription
kindArtistKindwhat it draws
nameStringlegend entry, or empty
xsFloatx values, or category indexes, or bar centers
ysFloaty values or bar heights
colorsFloatvalues mapped to the color scale (scatter), or Nil
sizesFloatvalues mapped to marker area (scatter), or Nil
edgesFloathistogram bin edges, or Nil