Skip to contents

Discrete colour scale using fundr palettes

Usage

scale_colour_fundr(
  palette = c("primary", "secondary", "tertiary"),
  direction = 1,
  ...
)

scale_color_fundr(
  palette = c("primary", "secondary", "tertiary"),
  direction = 1,
  ...
)

Arguments

palette

Palette name: "primary", "secondary", or "tertiary".

direction

If 1, use palette order; if -1, reverse.

...

Passed to ggplot2::discrete_scale().

Examples

library(ggplot2)

# Scatter plot with fundr colors
ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) +
  geom_point(size = 3) +
  scale_colour_fundr("secondary")


# US spelling also works
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
  geom_point(size = 3) +
  scale_color_fundr("tertiary")