Description Usage Arguments Examples
Custom fill scale functions for ggplot2. Handles discrete or continuous scales.
1 2 3 4 5 6 | scale_fill_wolves(
palette = "wooly_bully",
discrete = TRUE,
reverse = FALSE,
...
)
|
palette |
Character name of palette in wwfc_palettes |
discrete |
Boolean indicating whether fill aesthetic is discrete or not |
reverse |
Boolean indicating whether the palette should be reversed |
... |
Additional arguments passed to discrete_scale() or scale_fill_gradientn() according to whether discrete arg is TRUE or FALSE |
1 2 3 4 5 6 7 8 9 10 11 | # Fill by discrete variable with different palette + remove legend (guide)
# Note: you will probably want to avoid using colour in this way!
library(ggplot2)
ggplot(mpg, aes(manufacturer, fill = manufacturer)) +
geom_bar() +
wolves_theme(grid = "vgrid") +
coord_flip() +
scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
scale_fill_wolves(palette = "wooly_bully", guide = "none") +
labs(title = "scale_fill_wolves() can generate many colours from a palette",
subtitle = "Using colour in this way (despite consistent data type) is not recommended!")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.