# NOT RUN {
library("ggplot2")
# default colors
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point() + scale_color_discrete_sequential() + theme_classic()
# customization of named palette
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point() + scale_colour_discrete_sequential(palette = "Reds", nmax = 4, p2 = 1.5) +
theme_classic()
# color scale "Terrain"
ggplot(iris, aes(Sepal.Length, fill = Species)) +
geom_density(alpha = 0.7) + scale_fill_discrete_sequential(palette = "Terrain") + theme_minimal()
# }
Run the code above in your browser using DataCamp Workspace