Sample size does not show in the box; annotate it separately
Aliases: sample-size annotation · box plot sample-size blind spot · variable-width box plot
What it is
Sample-size annotation restores a dimension absent from standard equal-width box plots. Two samples with very different n can render identical boxes, whiskers, and medians when their summaries match, so the ordinary box does not reveal how many observations support it. Text n, raw points, or a clearly defined variable-width box can supply that information. Sample size is not, however, a substitute for uncertainty, representativeness, or data quality.
Why it happens
A box plot encodes sample-quantile locations, not how those estimates vary across repeated samples. More observations generally improve quantile precision, but the gain also depends on density near the target quantile, dependence, weights, and sampling design. A large biased sample can estimate the wrong target population very consistently; a well-designed small sample cannot be dismissed from n alone. McGill, Tukey, and Larsen introduced variable-width boxes to incorporate group size. A width proportional to √n or another quantity needs an explicit mapping and must not be confused with decorative width.
Studying it
Compare no-n, text-n, raw-point, variable-width, and uncertainty-interval versions. Test whether readers detect imbalance, reason about precision, and avoid treating n as significance. Manipulate distribution shape, sampling design, weights, group count, width mapping, and display size, measuring sample-size lookup separately from uncertainty judgment. In realistic workflows, determine whether n means rows, independent units, weighted effective sample size, or complete cases; those labels are not interchangeable.
Where it stops holding
Repeated labels may add little when every group has equal n and that fact remains visibly stable. Once filtering, missingness, or refresh can change counts, annotations should update. Hover cannot be the only route because touch, keyboard, screen readers, and static exports may not expose it. Variable width saves text but adds area or width decoding and should not stand alone when exact counts matter. With clustered or repeated measurements, row count is not independent information; annotate a count aligned with the inferential unit.
Applying it
- Display a clearly defined n for every group and update it with filters, missing-data handling, and time range; do not label only the smallest and largest groups.
- Name the count—participants, observations, complete cases, or effective sample size—and disclose weighting and clustering.
- If boxes vary in width, provide the width mapping and text n, ensuring width is not the only encoding on small screens or screen-reader routes.
- When precision matters, show confidence intervals, bootstrap distributions, or model results separately; do not ask readers to derive uncertainty from n alone.
- Test matched boxes with different n and matched n under different sampling designs. Readers should distinguish sample quantity, precision, and representativeness.
Related
- Same group: U2.09.1 Box plots compress a distribution into five statistics · U2.09.2 Whisker and outlier rules are not unique; state them with the chart · U2.09.3 The box plot's strength is comparing many distributions side by side · U2.09.5 Small-sample quartiles are unstable; box width is uninterpretable
- Nearby: U2.08.3 Showing the raw point distribution is more reliable · U1.08.5 The same field can take different types under different analytical tasks
- Search terms:
box plot sample size·variable-width box plot·effective sample size·quantile uncertainty