text
Freestanding text at a position: a mark that is nothing but its label.
text

#Attributes
On any plane
labelThe text itself — rich, so
$maths$ and inline formatting render.Can be written as shorthand:
text:valuetext-sizeText size.
Default
20colourColour.
paintAlso written:
colorDefault
neutralalignHow the text sits on its point:
middle centres it, start and end put its left or right edge there.Default
middlehiddenDeclared 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
falselockKeeps the reader from editing this element on an
editable: graph.Also written:
lockedDefault
falselayerPaint order among the marks: a higher layer is drawn later, on top; equal or omitted, the marks stack in document order, later on top.
groupThe groups this mark belongs to, comma-separated:
group: Early sown, Projected. It is drawn in the colour of the first that has one and the style of the first the graph's key: gives one, unless it writes its own colour: or style, and the footer's key names every group.Only with
xplanexX coordinate of the anchor.
Only with
xyplanexX coordinate of the anchor.
yY coordinate of the anchor.
Only with
argandplanezOn the argand plane, the anchor as one complex number — a complex expression:
3 + 2i, (3 + 2i)^2, with i the unit. Instead of re/im. In space, the z coordinate of the anchor.reOn the argand plane, the real part of the position, a number; with
im. z: gives both at once.imOn the argand plane, the imaginary part of the position, a number; with
re. z: gives both at once.Only with
polarplanerOn the polar plane, the distance from the origin; with
theta.thetaOn the polar plane, the angle anticlockwise from the right, in radians —
60deg writes it in degrees; with r. On a categorical theta (theta format:), a name.Only with
xyzplanexX coordinate of the anchor.
yY coordinate of the anchor.
zOn the argand plane, the anchor as one complex number — a complex expression:
3 + 2i, (3 + 2i)^2, with i the unit. Instead of re/im. In space, the z coordinate of the anchor.#Allowed in
#Examples


graph{
curve(expression: 4 - (x - 2)^2)
text(label: local maximum; x: 2; y: 4.5)
}(
x-domain: [0, 4]
y-domain: [0, 5]
)

graph{
fit(of: #readings; degree: 1)
text(label: $R^2 = 0.97$; x: 8; y: 1; align: start)
scatter#readings(x: 1, 2, 3, 4, 5, 6, 7; y: 1.1, 1.9, 3.2, 3.8, 5.1, 6.2, 6.8; colour: grey)
}(
x-domain: [0, 11]
)

graph:xyz{
surface(expression: 3 - x^2 - y^2; colour: green)
text(x: 0; y: 0; z: 3.6; label: summit)
}(
x domain: [-2, 2]
y domain: [-2, 2]
z domain: [-2, 4]
axis position: edges
)#Notes
- For annotations that belong to the plot rather than to any one mark: a region's name, a caption inside the frame, a worked value.
#Writing guidance
- Selecting canvas content — A mark belongs on the canvas when seeing it changes what the reader understands, and the detail holds as a picture on its own.