scale_color_ohsu: Color scale constructor for ohsu colors

View source: R/ohsu_palettes.R

scale_color_ohsuR Documentation

Color scale constructor for ohsu colors

Description

Color scale constructor for ohsu colors

Usage

scale_color_ohsu(palette = "main", discrete = TRUE, reverse = FALSE, ...)

scale_colour_ohsu(palette = "main", discrete = TRUE, reverse = FALSE, ...)

Arguments

palette

Character name of palette in ohsu_palettes

discrete

Boolean indicating whether color aesthetic is discrete or not

reverse

Boolean indicating whether the palette should be reversed

...

Additional arguments passed to discrete_scale() or scale_color_gradientn(), used respectively when discrete is TRUE or FALSE

Examples

library(ggplot2)
# Color by discrete variable using default palette
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
    geom_point(size = 4) +
    scale_color_ohsu()

# Color by numeric variable with cool palette
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Sepal.Length)) +
    geom_point(size = 4, alpha = .6) +
    scale_color_ohsu(discrete = FALSE, palette = "cool")

emilelatour/laviz documentation built on Nov. 11, 2024, 9:42 p.m.