Learn R Programming

khroma (version 1.10.0)

scale_logical_discrete: Binary Discrete Colour Schemes for ggplot2 and ggraph

Description

Provides a colour scale for logical values.

Usage

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

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

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

Value

A discrete scale.

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.

Author

N. Frerebeau

See Also

Other qualitative colour schemes: scale_colour_land(), scale_colour_soil(), scale_colour_stratigraphy(), scale_okabeito_discrete, scale_tol_bright, scale_tol_dark, scale_tol_highcontrast, scale_tol_light, scale_tol_mediumcontrast, scale_tol_muted, scale_tol_pale, scale_tol_vibrant

Examples

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

Run the code above in your browser using DataLab