Discrete ggplot2 scales that apply a stem colour palette to the colour or fill aesthetic.
Three aliases are provided:
scale_colour_stem()— maps to thecolouraesthetic (British spelling).scale_color_stem()— alias forscale_colour_stem()(American spelling).scale_fill_stem()— maps to thefillaesthetic.
All functions delegate to ggplot2::discrete_scale() via stem_palette_gen(), so any argument
accepted by discrete_scale() (e.g. name, breaks, labels, na.value, drop) can
be passed through ....
Usage
scale_fill_stem(palette = "div1", direction = 1, ...)
scale_colour_stem(palette = "div1", direction = 1, ...)
scale_color_stem(palette = "div1", direction = 1, ...)Arguments
- palette
Name of the palette. See
stem_palette()for the full list of valid names. Defaults to"div1".- direction
1(default) uses colours in their natural order;-1reverses the order.- ...
Additional arguments passed to
ggplot2::discrete_scale().
Examples
ggplot2::ggplot(data = mtcars,
mapping = ggplot2::aes(x = mpg, y = hp, color = as.factor(am))) +
ggplot2::geom_point() +
scale_colour_stem()