Skip to contents

Provides a colour scale for logical values.

Usage

scale_colour_logical(..., aesthetics = "colour")

scale_color_logical(..., aesthetics = "colour")

scale_fill_logical(..., aesthetics = "fill")

Arguments

...

Arguments passed to ggplot2::discrete_scale().

aesthetics

A character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with.

Value

A discrete scale.

Author

N. Frerebeau

Examples

library(ggplot2)

logic <- data.frame(
  x = rep(1:5, times = 5),
  y = rep(1:5, each = 5),
  values = sample(c(TRUE, FALSE), 25, TRUE)
)

ggplot2::ggplot(logic, ggplot2::aes(x, y, fill = values)) +
  ggplot2::geom_raster() +
  scale_fill_logical()