Set sgplot theme, colour palette and geom aesthetic defaults for ggplot2 charts.
Usage
use_sgplot(default_colour = sgplot::sg_colour_values["dark-blue"], ...)
Arguments
- default_colour
Default colour/fill for geoms. Default value is 'blue' from
sgplot::sg_colour_values
.- ...
Arguments passed to
sgplot::theme_sg()
.
Examples
library(ggplot2)
d <- subset(mpg, manufacturer == "ford")
ggplot(d, aes(x = model)) + geom_bar()
ggplot(d, aes(x = model, fill = class)) + geom_bar()
use_sgplot()
#> ℹ Default ggplot2 theme set to `theme_sg`.
#> ℹ Default colours set.
#> ℹ Default geom aesthetics set.
ggplot(d, aes(x = model)) + geom_bar()
ggplot(d, aes(x = model, fill = class, colour = class)) + geom_bar()