Three ways to draw attention
Each is a spec feature. It composes left to right in
pipe like any geom or scale, and it resolves again on every compile: annotations follow the data they are pinned to, and rules extend the axis domain.
Highlights
Predicate-driven emphasis: pick observations, groups, or a whole x-slice.
Reference lines
Goal lines, thresholds, and baselines with
geom.rule().Annotations
Difference arrows, shaded regions, text, arrows, images, stickers and pinned
dots.
Highlight vs. annotation vs. reference line
They overlap in purpose but differ in mechanism:- Use a highlight when the emphasis is about the data: “show me the EU group”, “dim everything below target”. The predicate selects real observations, so it survives data changes and re-sorts.
- Use a reference line to mark a constant value the data is read against: a sales goal, a capacity ceiling, a zero baseline.
- Use an annotation to add something the data does not contain: a label explaining a spike, an arrow between two points, a shaded “forecast” band.

