A color scale for ggplot2 based on the package palettes

scale_color_palette(palette = "sunset", discrete = TRUE, reverse = FALSE, ...)

Arguments

palette

Character name of the palette

discrete

Logical. Is the scale discrete or continuous?

reverse

Logical. Should the palette be reversed?

...

Additional arguments passed to discrete_scale() or scale_color_gradientn()

Value

A ggplot2 scale

Examples

if (FALSE) { # \dontrun{
library(ggplot2)
ggplot(mtcars, aes(wt, mpg, color = factor(cyl))) +
  geom_point(size = 4) +
  scale_color_palette("sunset")
} # }