library(ggplot2)
ggplot(msleep, aes(vore, sleep_total, fill = vore)) +
geom_boxplot() +
scale_fill_carto_d(palette = 6, direction = -1)
if (FALSE) {
library(sf)
library(spData)
library(ggplot2)
ggplot(world, aes(fill = lifeExp)) +
geom_sf(data = world) +
coord_sf(crs = "+proj=robin") +
scale_fill_carto_c(name = "Life expectancy: ",
type = "diverging", palette = "Earth", direction = -1) +
theme_void()
ggplot(world, aes(fill = region_un)) +
geom_sf(data = world) +
coord_sf(crs = "+proj=robin") +
scale_fill_carto_d(name = "Region: ", palette = "Safe") +
theme_void()
}
Run the code above in your browser using DataLab