Skip to contents

Categorical palettes that meet WCAG 1.4.1 (Use of Color) by being distinguishable to viewers with color vision differences.

Usage

scale_color_a11y(palette = "dark2_8", ...)

scale_fill_a11y(palette = "dark2_8", ...)

Arguments

palette

One of "dark2_8" (default), "set2_8", "paired_12", "aaa_5". See a11y_palette_list().

...

Passed to ggplot2::discrete_scale.

Value

A ggplot2 scale.

Examples

if (requireNamespace("ggplot2", quietly = TRUE)) {
  library(ggplot2)
  ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
    geom_point() + scale_color_a11y()
}