This is a color-blind friendly, qualitative scale with eight different colors. See palette_okabeito for details.

Arguments

...

common discrete scale parameters: name, breaks, labels, na.value, limits, guide, and aesthetics. See ggplot2::discrete_scale for more details.

use_black

If TRUE, scale includes black, otherwise includes gray.

order

Numeric vector listing the order in which the colors should be used. Default is 1:8.

darken

Relative amount by which the scale should be darkened (for positive values) or lightened (for negative values).

alpha

Alpha transparency level of the color. Default is no transparency.

Value

A color scale for use in plots created with ggplot2::ggplot().

Examples

library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point() + scale_color_okabeito()

ggplot(iris, aes(Sepal.Length, fill = Species)) +
  geom_density(alpha = 0.7) + scale_fill_okabeito(order = c(1, 3, 5))