scale_color_drsimonj: Color scale constructor for drsimonj colors

Description Usage Arguments Examples

View source: R/drsimonj_palettes.R

Description

Color scale constructor for drsimonj colors

Usage

1
2
3
scale_color_drsimonj(palette = "main", discrete = TRUE, reverse = FALSE, ...)

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

Arguments

palette

Character name of palette in drsimonj_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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(ggplot2)
# Color by discrete variable using default palette
ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
    geom_point(size = 4) +
    scale_color_drsimonj()

# 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_drsimonj(discrete = FALSE, palette = "cool")

emilelatour/laviz documentation built on May 17, 2020, 3:44 a.m.