
Discrete colour and fill scales for ggplot2
scale_colour_covalence_discrete.RdThe scale_*_covalence_discrete functions provide discrete scales of
Covalence colours for use in ggplot2 plots.
Usage
scale_colour_covalence_discrete(palette = "complete", reverse = FALSE)
scale_color_covalence_discrete(palette = "complete", reverse = FALSE)
scale_fill_covalence_discrete(palette = "complete", reverse = FALSE)Arguments
- palette
Palette to use. One of 'complete', 'main', 'accent', or 'rainbow_12_bit'.
- reverse
Should the palette be reversed? Either 'TRUE' or 'FALSE'.
Details
These functions are inspired by a 2022 blog post by Nicola Rennie.
Examples
library(ggplot2)
ggplot(data = diamonds, aes(x = carat, y = price)) +
geom_point(aes(colour = cut), alpha = 0.4) +
scale_colour_covalence_discrete(palette = "complete") +
theme_covalence()
ggplot(data = diamonds, aes(x = price)) +
geom_histogram(aes(fill = cut)) +
scale_fill_covalence_discrete(
palette = "rainbow_12_bit",
reverse = TRUE
) +
theme_covalence()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.