scale_OkabeIto: Okabe-Ito color scale

View source: R/color_scales.R

scale_OkabeItoR Documentation

Okabe-Ito color scale

Description

This is a color-blind friendly, qualitative scale with eight different colors from the colorblindr package (https://github.com/clauswilke/colorblindr).

Arguments

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.

...

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

Value

A discrete ggplot2 scale object. The helper aliases return the same scale with aesthetics preset for colour or fill mappings.

See Also

Other palettes: palette_OkabeIto, palette_UC, scale_UC()

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


Rbearcat documentation built on March 21, 2026, 5:07 p.m.