Compute a distribution part's empirical quantile cutoffs, per panel
Source:R/stat-cutoff.R
StatCutoff.RdCalls cutoff_plan(), the same function show_cutoffs() calls, so there is
exactly one implementation of the cutoff rule and the two consumers cannot
drift apart.
Format
A ggplot2::Stat object.
Details
The difference between the two is deliberate, not an oversight: show_cutoffs()
marks the whole distribution, because that is what a middle() fill shades –
every value in the plot's data is either inside or outside the shaded region,
regardless of which facet panel it lands in. This stat computes per panel,
because that is what a stat does with the rows ggplot2 hands it: a faceted plot
gets one set of cutoffs per panel, each drawn from that panel's own rows. Pair it
with ggplot2::GeomVline to draw the intercepts it emits – one for upper() or
lower(), two for middle(), tails(), or outer().
show_cutoffs() keeps its own annotate()-based rendering rather than being
rebuilt on this stat: its markers and labels are placed against the panel's npc
range in draw_panel()-adjacent code that a stat's compute_panel() has no
access to, and moving to a stat would silently turn its whole-distribution
marking into this per-panel one on any faceted plot – disagreeing with the
whole-data fill it marks.
See also
show_cutoffs(), which marks the same cutoffs by a different route.
