text
Freestanding text at (x, y) — a mark that is nothing but its label. It carries annotations belonging to the plot rather than to any one mark: a region's name, a caption inside the frame, a worked value.
Writing with it:Framing a readable graph
#Attributes
On any plane
The text itself — rich, so
$maths$ and inline formatting render.Can be written as shorthand: text:valuecolour
Also written: colorColour.
Default
neutralHow the text sits on its point:
middle centres it, start and end put its left or right edge there.Default
middleDeclared but not drawn. Animatable —
hidden: true !cue.to{false}(at: 2) reveals it — and a hidden element still frames the plot, so the axes do not jump when it appears.Default
falseAlso written: lockedKeeps the reader from editing this element on an
editable: graph.Default
falseOnly withplane
On the argand plane, the position as one complex number — a complex expression:
3 + 2i, (3 + 2i)^2, sqrt(13) * e^(i * a), with i the unit and parameters read as complex. Instead of re/im.#Allowed in
#Examples
text(label: local maximum; x: 2; y: 4.5)text(label: $R^2 = 0.97$; x: 8; y: 1; anchor: start)