style_scale_fill: Fill Scale Constructor for ggplot

View source: R/style_scale_fill.R

style_scale_fillR Documentation

Fill Scale Constructor for ggplot

Description

The purpose of style_scale_fill is to make our own colors! This includes the "duck hunt" color palette!

Usage

style_scale_fill(palette = "main", discrete = T, reverse = F, ...)

Arguments

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

Details

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

Value

An object of class "ggproto", for use in ggplot2::ggplot

Examples

# 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")

Huh/collar documentation built on Aug. 5, 2022, 11:02 p.m.