Skip to contents

Discrete fill scale using fundr palettes

Usage

scale_fill_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)

# Bar chart with fundr fill colors
ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) +
  geom_bar() +
  scale_fill_fundr("secondary")


# Reverse palette direction
ggplot(mtcars, aes(factor(cyl), fill = factor(cyl))) +
  geom_bar() +
  scale_fill_fundr("tertiary", direction = -1)