Skip to contents

IDEA color scale palette for ggplot2

Usage

scale_color_idea(
  palette = "div",
  discrete = TRUE,
  alpha = 1,
  reverse = FALSE,
  year = 2024,
  ...
)

scale_colour_idea(
  palette = "div",
  discrete = TRUE,
  alpha = 1,
  reverse = FALSE,
  year = 2024,
  ...
)

Arguments

palette

Choose from 'idea_palettes' list

discrete

whether to use a discrete color palette

alpha

transparency

reverse

logical, Reverse the order of the colours?

year

Defaults to the most recent branding guidelines (year = 2024), but year = 2019 also available

...

additional arguments to passed to `scale_color_gradientn`

Examples

library(ggplot2)

# Explicitly calls the 2024 branding guidelines
ggplot(mtcars, aes(mpg, wt)) +
  geom_point(aes(colour = factor(cyl))) +
  scale_colour_idea(palette="qual", year = 2024)


# Explicitly calls the 2019 branding guidlines
ggplot(mtcars, aes(mpg, wt)) +
  geom_point(aes(colour = hp)) +
  scale_colour_idea(palette="qual", discrete = FALSE, year = 2019)


# Chooses the bluegray palette
ggplot(data = mpg) +
  geom_point(mapping = aes(x = displ, y = hwy, color = class)) +
  scale_colour_idea(palette="bluegray")