Learn R Programming

ratlas (version 0.1.1)

scale_colour_okabeito: Okabe-Ito color scale

Description

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

Value

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

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.

Examples

Run this code
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))

Run the code above in your browser using DataLab