These functions plug prakriti palettes into ggplot2. By default the
scale type (discrete vs. continuous) is chosen from the palette's metadata:
qualitative palettes default to discrete; sequential and diverging palettes
default to continuous. Override with discrete.
Usage
scale_color_prakriti(name, ..., discrete = NULL, direction = 1)
scale_colour_prakriti(name, ..., discrete = NULL, direction = 1)
scale_fill_prakriti(name, ..., discrete = NULL, direction = 1)Arguments
- name
Character. Name of the palette. See
prakriti_names().- ...
Additional arguments passed to the underlying ggplot2 scale constructor (
ggplot2::discrete_scale(),ggplot2::scale_color_gradientn(), orggplot2::scale_fill_gradientn()).- discrete
Logical or
NULL. IfNULL(default), inferred from the palette'stype. SetTRUEto force discrete,FALSEfor continuous.- direction
1(default) or-1to reverse the palette order.
Examples
# \donttest{
library(ggplot2)
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
geom_point(size = 3) +
scale_color_prakriti("valley_of_flowers")
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_raster() +
scale_fill_prakriti("himalaya")
# }
