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() ~ StringReturn
| Type | Description |
|---|---|
| String | the text, empty for a line |
HasArrow #
Whether the text points at a position with a line.
method : public : HasArrow() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true for an annotation |
IsLine #
Whether this is a reference line.
method : public : IsLine() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true for a line |
New # constructor
Constructor
New(is_line:Bool, x1:Float, y1:Float, x2:Float, y2:Float, text:String, arrow:Bool)Parameters
| Name | Type | Description |
|---|---|---|
| is_line | Bool | true for a reference line from (x1, y1) to (x2, y2); false for text |
| x1 | Float | first x, or the point a text or annotation refers to |
| y1 | Float | first y |
| x2 | Float | second x, or where an annotation's text sits |
| y2 | Float | second y |
| text | String | the string, or empty for a line |
| arrow | Bool | true for an annotation: text at (x2, y2) with a line to the point (x1, y1) |