← Gallery
Box and whisker
03 of 23Clouds (v1)
v1's cloud plot: whiskers, caps and a box per cloud, each box filled with the cloud's photo.
- Scale
- Tick
- gutter Label
- sortBy
The simple version
Boxes and whiskers from summary(), one slat per group. The same structure with almost no styling: a good place to start your own.
How it’s built
A box plot is five numbers drawn as three blocks.
summary(d.samples) turns a list of samples into low, q1, median, q3 and high, worked out once per slat with createMemo.
The slat then draws:
- a thin
Barfromlowtohigh, which is the whisker, - a
Barfromq1toq3, which is the box, - a
Tickat the median.
The gallery version keeps those three blocks and adds:
- A photo inside the box.
The box
Barholds an<img>, so the Bar crops the photo to that cloud’s range, and hovering the slat zooms it out. - Caps on the whiskers.
A
Tickis a short line across the slat, which is exactly what a cap is, so one at each end finishes the whisker. - The slider changes one number. It moves where one cloud’s box ends, and the whisker, the scale and the ranking all follow, because each of them is worked out from the same data.
The cloud photographs are from Wikimedia Commons.