scale_logical_discrete: Binary Discrete Color Schemes for 'ggplot2' and 'ggraph'

scale_logical_discreteR Documentation

Binary Discrete Color Schemes for ggplot2 and ggraph

Description

Provides a color 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(s)

N. Frerebeau

See Also

Other qualitative color 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

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

khroma documentation built on Aug. 21, 2023, 5:11 p.m.