View source: R/style_scale_fill.R
style_scale_fill | R Documentation |
The purpose of style_scale_fill is to make our own colors! This includes the "duck hunt" color palette!
style_scale_fill(palette = "main", discrete = T, reverse = F, ...)
palette |
Character name of palette in cllr_palettes |
discrete |
Boolean; Is the color aesthetic discrete or not? |
reverse |
Boolean; Should the colors be reversed? |
... |
Additional arguments which can be passed to ggplot2::disrete_scale() or ggplot2::scale_color_gradientn(), used when discrete is true or false, respectively |
There are four color schemes to choose from: 1) "main" = simple colors, duckhunt; "NULL" value 2) "duckhunt" = palette from duckhunt 3) "cblind" = color blind palette 4) "gray" = gray scale if you're boring If discrete = F, will pick gradient between discrete colors
An object of class "ggproto", for use in ggplot2::ggplot
# Create a bar graph with continuous color palette, duckhunt
ggplot2::ggplot(ggplot2::mpg, ggplot2::aes(manufacturer, fill = manufacturer)) +
ggplot2::geom_bar() +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, hjust = 1)) +
style_scale_fill(palette = "duckhunt", guide = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.