library(ggplot2)
# Discrete data
data(iris)
disc <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Species)) +
geom_point() + theme_classic()
disc <- disc + scale_color_doypa(palette = "buzz", discrete = TRUE)
print(disc)
# Continuous data
cont <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Sepal.Length)) +
geom_point() + theme_classic()
cont <- cont + scale_color_doypa(palette = "buzz")
print(cont)
# Colorblind-friendly palette
disc_colorblind <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length, color = Species)) +
geom_point() + theme_classic()
disc_colorblind <- disc_colorblind + scale_color_doypa(colorblind = TRUE, discrete = TRUE)
print(disc_colorblind)
Run the code above in your browser using DataLab