View source: R/scale_discrete_sg.R
scale_colour_discrete_sg | R Documentation |
Discrete colour/fill scales for Scottish Government plots
scale_colour_discrete_sg(
palette = "main",
palette_type = "sg",
reverse = FALSE,
...
)
scale_fill_discrete_sg(
palette = "main",
palette_type = "sg",
reverse = FALSE,
...
)
palette |
Name of palette to use; e.g. "main", "sequential", "focus". Default value is "main". |
palette_type |
Name of palette type to use. Defaults to "sg". For all
available palette types, run |
reverse |
Boolean value to indicate whether the palette should be reversed. |
... |
Additional arguments passed to scale type. |
ggplot2 discrete colour/fill scale
library(ggplot2)
library(dplyr)
economics_long %>%
filter(variable %in% c("psavert", "uempmed")) %>%
ggplot(aes(x = date, y = value, colour = variable)) +
geom_line(linewidth = 1) +
scale_colour_discrete_sg()
d <- subset(mpg, manufacturer == "ford")
ggplot(d, aes(x = class, fill = class)) +
geom_bar() +
scale_fill_discrete_sg()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.