
Colour scales for changepoint labels and label errors
Source:R/geoms-regions.R
scale_fill_cpt_label.RdA colour-vision-deficiency-safe fill scale covering both vocabularies the
supervised-detection displays use: the label's assertion
(change / no_change / one_change) and the outcome of
scoring a segmentation against it (correct / false_positive
/ false_negative). Unknown values fall back to grey rather than
erroring, so a partially-scored frame still plots.
Usage
scale_fill_cpt_label(..., na.value = "grey70")
scale_colour_cpt_label(..., na.value = "grey70")Arguments
- ...
Passed to
ggplot2::scale_fill_manual()/ggplot2::scale_colour_manual().- na.value
Fill for values outside the vocabulary.
See also
Other accessibility scales:
scale_colour_cpt(),
theme_ggcpt()
Examples
library(ggplot2)
labs <- cpt_labels(c(40, 70), c(60, 90), c("change", "no_change"))
ggplot(labs, aes(xmin = start, xmax = end, ymin = 0, ymax = 1,
fill = change)) +
geom_rect() + scale_fill_cpt_label()
# the same palette covers correct / false_positive / false_negative
class(scale_colour_cpt_label())
#> [1] "ScaleDiscrete" "Scale" "ggproto" "gg"