library("ggplot2")
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_igray()
palettes <- ggthemes_data[["tableau"]][["color-palettes"]][["regular"]]
for (palette in head(names(palettes), 3L)) {
print(p + scale_colour_tableau(palette) +
ggtitle(palette))
}
# the order of colour can be reversed
p + scale_color_tableau(direction = -1)
Run the code above in your browser using DataLab