plot
Draw labeled data series on an existing grid using DATA values, avoiding coordinate math. Add lines, markers, and point labels for diagrams and annotations.
Instructions
Plot data on a grid made with the grid tool, in DATA values — no coordinate maths.
grid: that grid's id_prefix. Each series: {"points": [[x, y], ...], "line": true, "stroke": "#1f77b4",
"stroke_width", "stroke_dasharray", "marker": "circle"|"square"|"diamond"|"none", "marker_size",
"marker_fill" (default white), "point_labels": ["", "COP 3.2", ...] (one per point, null/"" to skip),
"label_offset": [dx, dy], "label_anchor": "start"|"middle"|"end", "label_halo": "#ffffff"|"none",
"label_font_size", "label_color", "font_family", "id", "layer"}.
Labels: label_offset is from the point to the label's anchor, and the label is vertically CENTRED on
point + dy (dy = 0 → centred on the point). Anchor defaults to start for dx >= 0, else end. Without
label_offset the label goes right of the point, on the side the line is not heading to. Labels carry a
halo stroke (default white) so the line can cross them — set label_halo "none" (or the background
colour) for labels on dark fills; recolouring a label later does not remove its halo (use stroke: "none").
Ids follow the series id: -line, -marker-, -label- (k = 1-based point index).
Returns per series those ids and the points in user units (for annotations); warns about points
outside the grid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grid | No | grid | |
| doc_id | No | ||
| series | Yes | ||
| preview | No |