scatter

scatterNode

A set of points, one axis per attribute: scatter(x: 0, 1, 2; y: 0, 2, 1) — or dataset columns, scatter(x: #islands.area; y: #islands.species). One shape, size and colour apply to all of them. A fit in the same environment fits this data.

#Attributes

On any plane

period
Also written: atLong-format data: one row per x per period, this naming the period column. The points then show the slice at whatever the environment's parameter.time holds, gliding between the two periods that bracket it.
errorAnimatable
Also written: error-yThe uncertainty on each reading up the y axis, drawn as a bar through its dot with a cap at each end. HALF-widths: an error of 0.3 on a reading of 4.2 spans 3.9 to 4.5. One entry per reading, paired by position as the coordinates are — or a column bound whole, which is the usual case, since a measurement's uncertainty arrives in the file beside it. Nothing is drawn where an entry is missing. Refused on the number line, which has no y for a reading to be uncertain in, and on the polar plane, where a bar across a radius or an angle is not the interval it stands for.
error-xAnimatable
The same, along the x axis — the uncertainty a reading on a number line can have, and the horizontal half of an error cross on a plane. Both may be given at once.
shape
circlesquarerectangletrianglestardiamondhexagoncross
Point shape.
Defaultcircle
sizeAnimatable
Point size.
Default6
colourAnimatable
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblack
Also written: colorColour.
Defaultred
opacityAnimatable
Opacity.
Default1
Text drawn beside the element — rich text, so $maths$ and inline formatting render. Fades and draws with the element.
hiddenAnimatable
Declared but not drawn. Animatable — hidden: true !cue.to{false}(at: 2) reveals it — and unlike a cue, a hidden element still frames the plot, so the axes do not jump when it appears.
Defaultfalse
Also written: lockedKeeps the reader from editing this element on an editable: graph. Nothing at all on a graph that is not editable.
Defaultfalse
layerAnimatable
Paint order among the marks: a higher layer is drawn later, on top; equal or omitted, the marks stack in document order (later on top). Written z: before the argand plane took that letter for its coordinate.
Only withxplane
xImplicitAnimatable
The observations' x values: numbers, or a dataset column (#islands.area). A column of names reads against a categorical axis (x format:, or the axis’s auto rule); an ISO date column reads as fractional years (2024-03-15 → ≈2024.2), and auto labels them in years. Paired with y by position; a pair either axis cannot read as a number is dropped whole.Can be written as shorthand: scatter:value
jitterAnimatable
How far a dot is nudged off the reading it stands for, so that readings landing on each other can be counted by eye. Zero, the default, nudges nothing. On the number line (canvas.graph:x) it is room across the line, as a share of the mark's lane: zero is the dot plot — equal readings stack and the height of a column is the count — and above zero they scatter, which is what a sample of a few hundred readings has to be drawn as, and what spreads the readings across a boxplot of the same sample, which shares their lane. On the xy and argand planes both coordinates are the reading's own, and there the nudge is a share of the smallest non-zero gap between the values on each axis, at most half a gap either way, so a dot never crosses the place a different reading would have been (an axis whose readings are all equal is not nudged at all). Refused on the polar plane, where an amount of theta is a different distance at every radius.
Default0
Only withxyplane
xImplicitAnimatable
The observations' x values: numbers, or a dataset column (#islands.area). A column of names reads against a categorical axis (x format:, or the axis’s auto rule); an ISO date column reads as fractional years (2024-03-15 → ≈2024.2), and auto labels them in years. Paired with y by position; a pair either axis cannot read as a number is dropped whole.Can be written as shorthand: scatter:value
yAnimatable
The observations' y values, paired with x by position.
jitterAnimatable
How far a dot is nudged off the reading it stands for, so that readings landing on each other can be counted by eye. Zero, the default, nudges nothing. On the number line (canvas.graph:x) it is room across the line, as a share of the mark's lane: zero is the dot plot — equal readings stack and the height of a column is the count — and above zero they scatter, which is what a sample of a few hundred readings has to be drawn as, and what spreads the readings across a boxplot of the same sample, which shares their lane. On the xy and argand planes both coordinates are the reading's own, and there the nudge is a share of the smallest non-zero gap between the values on each axis, at most half a gap either way, so a dot never crosses the place a different reading would have been (an axis whose readings are all equal is not nudged at all). Refused on the polar plane, where an amount of theta is a different distance at every radius.
Default0
Only withargandplane
zAnimatable
On the argand plane, the readings as complex numbers: written out (1 + i, 2 - i, -3i, a bare number a real), or a column of complex literals bound whole (#roots.z). Instead of re/im.
reAnimatable
On the argand plane, the readings' real parts, one per reading — numbers written out or a column — paired with im by position.
imAnimatable
On the argand plane, the readings' imaginary parts, paired with re by position.
jitterAnimatable
How far a dot is nudged off the reading it stands for, so that readings landing on each other can be counted by eye. Zero, the default, nudges nothing. On the number line (canvas.graph:x) it is room across the line, as a share of the mark's lane: zero is the dot plot — equal readings stack and the height of a column is the count — and above zero they scatter, which is what a sample of a few hundred readings has to be drawn as, and what spreads the readings across a boxplot of the same sample, which shares their lane. On the xy and argand planes both coordinates are the reading's own, and there the nudge is a share of the smallest non-zero gap between the values on each axis, at most half a gap either way, so a dot never crosses the place a different reading would have been (an axis whose readings are all equal is not nudged at all). Refused on the polar plane, where an amount of theta is a different distance at every radius.
Default0
Only withpolarplane
rAnimatable
On the polar plane, the readings' distances from the origin, paired with theta by position.
thetaAnimatable
On the polar plane, the readings' angles in radians (60deg for degrees), paired with r by position; names on a categorical theta.

#Allowed in

#Examples

scatter(x: 0, 1, 2; y: 0, 2, 1)
scatter(x: -1, 0, 1; y: 1, 0, -1; shape: square; colour: red)
scatter(x: #islands.area; y: #islands.species)