Colours the fill aesthetic with an ltc palette, the way
scale_fill_viridis() does. Set discrete = FALSE for a continuous scale.
Arguments
- name
Character or unquoted name. The name of the desired palette.
- discrete
TRUEfor a discrete scale,FALSEfor a continuous one.- direction
1 keeps the palette order, -1 reverses it.
- ...
Passed on to
ggplot2::discrete_scale()whendiscrete = TRUE, or toggplot2::scale_fill_gradientn()whendiscrete = FALSE.
Examples
library(ggplot2)
# discrete
ggplot(mtcars, aes(factor(cyl), mpg, fill = factor(cyl))) +
geom_boxplot() +
scale_fill_ltc(maya)
# continuous
ggplot(faithfuld, aes(waiting, eruptions, fill = density)) +
geom_raster() +
scale_fill_ltc(heatmap0, discrete = FALSE)