scatter
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
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.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.
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
Default
circlecolour
Also written: colorColour.
Default
redText drawn beside the element — rich text, so
$maths$ and inline formatting render. Fades and draws with the element.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.Default
falseAlso written: lockedKeeps the reader from editing this element on an
editable: graph. Nothing at all on a graph that is not editable.Default
falseOnly withplane
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:valueHow 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.Default
0Only withplane
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:valueHow 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.Default
0Only withplane
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.On the argand plane, the readings' real parts, one per reading — numbers written out or a column — paired with
im by position.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.Default
0#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)