Skip to contents

Enables the customization of the color aesthetic using pre-defined or custom AU color palettes.

Usage

scale_color_au(
  style = "light",
  reverse = FALSE,
  discrete = FALSE,
  colors = NA,
  na.value = au_colors("grey"),
  ...
)

Arguments

style

String, color palette style. Could be light, dark, hotandcold, hotandcold_dark, or custom. Default palette is light.

reverse

Boolean, TRUE reverses the color order.

discrete

Boolean, TRUE applies a discrete color scale, FALSE applies a continuous color scale. Default is FALSE.

colors

Vector of AU color names. Only used when style = "custom" is passed in.

na.value

String or named vector, the color to use for NA values. Default is au_colors("grey"), corresponding to #878787.

...

Arguments passed on to scale_color_manual or scale_color_gradientn.

Value

A ggproto ScaleContinuous or ScaleDiscrete object.

Examples

ggplot2::ggplot(iris, ggplot2::aes(x = Petal.Width, y = Petal.Length, color = Species)) +
ggplot2::geom_point(size = 5, alpha = 0.3) +
ggpubr::theme_pubr() +
scale_color_au(discrete = TRUE)