scale_fill_ohsu: Fill scale constructor for ohsu colors

View source: R/ohsu_palettes.R

scale_fill_ohsuR Documentation

Fill scale constructor for ohsu colors

Description

Fill scale constructor for ohsu colors

Usage

scale_fill_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_fill_gradientn(), used respectively when discrete is TRUE or FALSE

Examples

library(ggplot2)
# Fill by discrete variable with different palette + remove legend (guide)
ggplot(mpg, aes(manufacturer, fill = manufacturer)) +
    geom_bar() +
    theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
    scale_fill_ohsu(palette = "mixed", guide = "none")

emilelatour/laviz documentation built on Oct. 15, 2023, 1:41 p.m.