Description Usage Arguments Examples
Custom colour scale functions for ggplot2. Handles discrete or continuous scales.
1 2 3 4 5 6 | scale_colour_wolves(
palette = "wooly_bully",
discrete = TRUE,
reverse = FALSE,
...
)
|
palette |
Character name of palette in wwfc_palettes |
discrete |
Boolean indicating whether colour aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_color_gradientn() according to whether discrete arg is TRUE or FALSE |
1 2 3 4 5 6 7 8 9 10 11 12 | # Color by discrete variable using default palette
library(ggplot2)
ggplot(iris, aes(Sepal.Width, Sepal.Length, colour = Species)) +
geom_point(size = 4) +
wolves_theme() +
scale_colour_wolves()
# Color by numeric variable with likert palette
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Sepal.Length)) +
geom_point(size = 4) +
wolves_theme() +
scale_colour_wolves(discrete = FALSE, palette = "sir_jack")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.