Discrete colour/fill scales for Scottish Government plots
Source:R/scale_discrete_sg.R
scale_colour_discrete_sg.Rd
Discrete colour/fill scales for Scottish Government plots
Arguments
- palette
Name of palette to use; e.g. "main", "sequential", "focus". Default value is "main".
- palette_type
Either "sg" to use Scottish Government palettes (default), "sss" to use Social Security Scotland palettes or "af" to use Analysis Function palettes.
- reverse
Boolean value to indicate whether the palette should be reversed.
- ...
Additional arguments passed to scale type.
Examples
library(ggplot2)
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
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()