boxplot

boxplotNode

A sample drawn as its five-number summary, on the number line (canvas.graph:x) and nowhere else. boxplot(x: 2, 3, 3, 4, 7, 9) takes the readings themselves, the way a scatter does, and works the summary out: the box spans the quartiles with the median ruled across it, and the whiskers run out to the readings beyond them. The quartiles are Tukey's hinges — the median splits the ordered readings in two, itself in neither half when the count is odd, and each quartile is the median of its half — which is what a box plot has always drawn and what a class is taught to find by hand. Several boxplots share the room above the line, a lane each in source order, alongside the scatter dot plots — except that a box and a scatter of the *same readings* are one sample drawn twice and take one lane, so writing both puts the summary over the readings with nothing to position by hand. Which is drawn over which is source order and layer:, as for any pair of marks.

#Attributes

xImplicitAnimatable
The readings — numbers written out, or a dataset column bound whole (#trial.mass). The sample itself, not a summary of it: a summary written by hand cannot be checked against the sample it claims to summarise. A row that is not a number drops.Can be written as shorthand: boxplot:value
whiskersAnimatable
fencesextremes
How far the whiskers reach. fences stops each at the furthest reading within one and a half interquartile ranges of its quartile and draws whatever lies beyond as its own dot; extremes runs them to the smallest and largest readings, and then nothing stands out.
Defaultfences
outliersAnimatable
Draw the readings past the fences. On by default: the whiskers stop where they stop either way, so a box with its outliers left off claims a reach the sample does not have and says nothing about the readings it dropped. !outliers takes them off anyway — for a scene about the middle of a distribution rather than its tails, and for one that puts them back on a step, since it is animatable (outliers: false !cue.to{true}(at: 2)). The frame still holds them, so fading them in does not move the axis. Nothing under whiskers: extremes, which has no reading outside its whiskers.
Defaulttrue
colourAnimatable
neutralredorangeyellowgreentealbluepurplepinkgreywhiteblack
Also written: colorColour.
Defaultblue
widthAnimatable
The share of its lane the box is thick. The whisker caps are half of it and the outlier dots ride the middle, so one number sets the weight of the whole mark.
Default0.5
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. It holds its lane the same way, drawn yet or not, so a box arriving on a step lands beside the marks already on the line rather than moving them.
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
text-sizeAnimatable
Text size.
Default20
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.

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or !value:#id.name in prose, never set.

medianDerived
The middle reading — the rule across the box.
q1Derived
The lower quartile: the median of the lower half of the ordered readings.
q3Derived
The upper quartile: the median of the upper half.
iqrDerived
The interquartile range, q3 − q1 — the width of the box.
minDerived
The smallest reading in the sample, whether or not a whisker reaches it.
maxDerived
The largest reading in the sample, whether or not a whisker reaches it.

#Allowed in

#Examples

boxplot(x: 2, 3, 3, 4, 4, 5, 5, 7, 12)
boxplot(x: #trial.mass; colour: teal; label: control)
boxplot(x: #trial.mass; whiskers: extremes)