Usage
show_cutoffs(plot, color = "#1e3a8a", size = 4, labels = FALSE)
Arguments
- plot
A ggplot histogram with fill mapped to a distribution part
function, e.g., fill = ~middle(Thumb, .95).
- color
Marker/line color. Default "#1e3a8a".
- size
Marker size. Default 4.
- labels
Whether to add text annotations explaining the cutoffs.
Default FALSE.
Value
A ggplot object with cutoff markers and optional labels.
Details
Adds downward-pointing triangle markers at the empirical quantile cutoffs on
a histogram that uses a distribution part function (middle(), tails(),
upper(), lower(), or outer()) in its fill aesthetic.
Examples
gf_histogram(~Thumb, data = Fingers, binwidth = 5, fill = ~middle(Thumb, .95)) %>%
show_cutoffs(labels = TRUE)