grid
Draw graph-paper lines inside a rectangle with linear or logarithmic axes, labels, and adjustable weights—no manual line-position calculations.
Instructions
Draw a grid / graph paper inside rect [x, y, w, h] — linear or logarithmic per axis — without
computing any line positions. Axis specs:
linear: {"scale": "linear", "major": 10, "medium": 5, "minor": 1, "label_start": 0, "label_step": 1}
(spacings in user units, each a whole multiple of the finest; labels on major lines)
log: {"scale": "log", "cycles": 3, "subdivisions": "standard" | "fine" | "integers", "start": 10}
(decades major, 2..9 medium, subdivisions minor; "start" = value at the origin (default 1);
"labels": "decades" (start, start*10, ...; default when start is given) | "paper" (1..9 per cycle))
"reverse": true flips an axis (default x left→right, y bottom→top); "lines": false keeps the axis
(labels, plot mapping) but draws none of its gridlines, e.g. vertical-only lines for a bar chart.
weights: {"major", "medium", "minor"} stroke widths (defaults 0.45/0.22/0.08 mm); border: stroke width
of the frame (default 0.6 mm, 0 = none). labels: {"sides": ["left", "bottom"], "font_size", "gap",
"color", "font_family", "bold_major", "x_title", "y_title", "title_font_size"} — placed outside the
grid, centred on their lines (measured); major labels are bold unless "bold_major": false; titles go
below / left (rotated) of the tick labels.
Result: one path per weight class in layers ' minor/medium/major', labels in
' labels'. Use plot with grid= to draw data on it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| rect | Yes | ||
| color | No | #7f7f7f | |
| border | No | ||
| doc_id | No | ||
| labels | No | ||
| preview | No | ||
| weights | No | ||
| id_prefix | No | grid | |
| layer_prefix | No | Grid |