This package seeks to create an easy theme to add to any ggplot to keep it in line with DfE brand guidelines. Simply transforms existing ggplots into the house style of the Department for Education.
There are two functions that work to add in colour scales: scale_fill_dfe()
and scale_colour_dfe()
. These replace the usual scale_colour_*()
and scale_fill_*()
functions to change colours on ggplot.
These are the base colours
There are also palettes, passed to the ‘palettes’ argument. These are for selecting a suitable subset of the colours above, depending on if you need a discrete, continuous or diverging palette.
Examples of usage would be:
ggplot2::ggplot(data = iris)+
ggplot2::aes(x=Sepal.Length, colour = Species)+
ggplot2::geom_density(linewidth = 1.5)+
scale_colour_dfe(palette = "main")+
labs(title = "Default title is in dark blue",
subtitle = "Default subtitle and copy text are dark grey",
caption = "Using theme_dfe_light()")+
theme_dfe_light()
For clearer plot boundaries, there is also theme_nimbus()
.
plot <- ggplot(ggplot2::diamonds, aes(carat, price)) + geom_point() +
labs(title = "Theme_nimbus",
subtitle = "",
caption = "theme_nimbus()")
plot + theme_nimbus()