10.9 Chart design: colors, legends, axes and tooltips
The shared classic chart style emphasizes black left and bottom axes, outward ticks and restrained grid use. This reduces decoration, but it does not remove the obligation to explain scales, units, grouping and uncertainty.
Stable semantic colors
VPC defaults assign orange to the median, blue to outer intervals, black to observations, gray to points, red to observations outside an interval and dark gray to references. Web variants use theme tokens so contrast can adapt. A command can permit overrides, but a color should retain the same meaning across panels in one analysis.
The outside-band red is a visual locator, not an automatic declaration that the model is invalid. Expected tail behavior, multiplicity, binning and censoring must be considered. Captions should avoid causal language that the plot does not establish.
Numeric formatting
The plot formatter uses scientific notation for very small or very large magnitudes, trims unnecessary trailing zeros and suppresses negative zero. Non-finite display uses an en dash, with negative infinity given the special <LLOQ representation in relevant contexts. Machine files may encode the same concept differently; never infer a CSV missing-value convention from an axis label.
Legends and direct labels
Legends should name statistics, populations and intervals explicitly—for example “simulated 5th–95th percentile interval,” not “blue area.” Direct labels can reduce eye travel but may collide in dense figures. If a legend is omitted for a publication panel, the caption must restore the mapping.
Tooltips and titles
Native SVG <title> nodes support hover information for web inspection. They are useful for exact bin or point context, yet they disappear from screenshots and paper. Tooltips should augment visible axes, labels and tables. Never hide a warning, excluded count or interval definition exclusively in a tooltip.
Axes and transformations
State units, transformations and inclusion rules. A log axis changes visual distance, not the underlying observations. A truncated axis can exaggerate differences. Facets with free scales can reveal within-panel patterns but obstruct between-panel magnitude comparisons. These are scientific design choices, not merely formatting.
Common mistakes
- Explaining series by color alone.
- Treating an outside-band point as a hypothesis test result.
- Omitting units or a log-scale declaration.
- Relying on tooltips for information needed in print.
Checklist
- Verify semantic colors and line styles across all panels.
- Define every interval, reference and transformation.
- Check formatted ticks at extreme and near-zero values.
- Ensure the caption stands alone without hover interaction.
Further reading
See themes and accessibility, figure families and the planned Chapter 27 on VPC interpretation.