scale_color_smith_c: Smith College color palettes

View source: R/colors.R

scale_color_smith_cR Documentation

Smith College color palettes

Description

Smith College themed ggplot2 color palettes

Usage

scale_color_smith_c(reverse = FALSE, ...)

scale_fill_smith_c(reverse = FALSE, ...)

scale_color_smith_cd(reverse = FALSE, ...)

scale_fill_smith_cd(reverse = FALSE, ...)

scale_color_smith_d(...)

scale_fill_smith_d(...)

smith_pal_categorical(n)

Arguments

reverse

Reverse the order of colors?

...

arguments passed to methods

n

number of colors desired

References

https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2

Examples


if (require(ggplot2)) {
  x <- ggplot(mtcars, aes(x = disp, y = mpg, color = mpg)) +
    geom_point()
  x + scale_color_smith_c(reverse = TRUE)
  x + scale_color_smith_cd(midpoint = 20)
  x + aes(color = factor(am)) + scale_color_smith_d()
  x + aes(color = factor(gear)) + scale_color_smith_d()
  x + aes(color = factor(carb)) + scale_color_smith_d()
  x + aes(color = factor(am)) + scale_fill_smith_d()

  y <- ggplot(mtcars, aes(x = cyl, fill = factor(am))) + geom_bar(position = "dodge")

  ggplot(mpg, aes(y = hwy, x = reorder(model, hwy), color = displ, fill = hwy)) +
    geom_col(position = "dodge") +
    coord_flip() +
    facet_wrap(~year) +
    scale_fill_smith_cd(midpoint = 20) +
    scale_color_smith_c()
}
smith_pal_categorical(2)

SmithCollege-SDS/sds documentation built on March 7, 2024, 9:53 p.m.