scale_colour_sphsu | R Documentation |
Unit colours for ggplot2 graphs
scale_colour_sphsu(palette = "mixed", discrete = TRUE, reverse = FALSE, ...)
palette |
Character. Calls a palette from sphsu_cols. Current schemes are "main", "cool", "hot" and "mixed". |
discrete |
Logical. Toggle to represent discrete or continuous data. |
reverse |
Logical. Reverse order of colours at assignment. |
... |
other arguments passed on to discrete_scale (for discrete data) or scale_colour_gradient (for continuous). |
These functions call colour palettes based on Unit colour schemes
Andy Baxter
ggplot(iris, aes(Sepal.Width, Sepal.Length, col = Species)) +
geom_point(size = 4) +
scale_colour_sphsu()
ggplot(iris, aes(Sepal.Width, Sepal.Length, col = Sepal.Length)) +
geom_point(size = 4) +
scale_colour_sphsu("hot", discrete = FALSE)
ggplot(iris, aes(Sepal.Width, Sepal.Length, col = Sepal.Length)) +
geom_point(size = 4) +
scale_colour_sphsu("cool", discrete = FALSE)
ggplot(mpg, aes(manufacturer, fill = manufacturer)) +
geom_bar() +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
scale_fill_sphsu(palette = "mixed", guide = "none")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.