Minnesota state brand themes and helper functions for ggplot2. Includes default styles and state agency logos.
You can install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("tidy-MN/mnthemes")
- Themes: Minnesota branded themes (
theme_mn()
,theme_mn_dark()
, …) - Logos: Add agency logo to plot (
add_mn_logo()
,add_mn_logo("MPCA")
)
p <- ggplot(mtcars, aes(x = mpg, y = wt), ) +
labs(title = "Minnesota branded plot",
subtitle = "Ope! Things are going downhill but it could be worse.",
caption = "Data from somewhere, 2024-2025",
x = "MPG",
y = "Weight") +
lims(x = c(10, NA), y = c(0, NA))
p +
geom_point(color = "#003865", size = 7, alpha = 0.5) +
theme_mn()
p +
geom_point(color = mn_color("gold"), size = 12, alpha = 0.75) + #"#F0F0F0"
theme_mn_dark()
p +
geom_point(color = "white", size = 12, alpha = 0.75) + #"#F0F0F0"
theme_mn_dark(text_color = mn_color("gold"))
p +
geom_point(color = "white", fill = scales::alpha(mn_color("gold"), 0.75),
size = 15, shape = 21) +
geom_smooth(color = mn_color("offwhite")) +
theme_mn_dark(bg_color = "accent green", text_color = "white")
p +
geom_point(color = "white", fill = scales::alpha(mn_color("gold"), 0.75),
size = 15, shape = 21) +
geom_smooth(color = mn_color("offwhite")) +
theme_mn_dark(bg_color = "accent green",
text_color = "white",
banner = TRUE,
banner_color = "offwhite",
banner_text_color = "accent green")
p +
geom_point(color = "white", fill = scales::alpha(mn_color("gold"), 0.75),
size = 12, shape = 21) +
geom_smooth(color = mn_color("offwhite")) +
theme_mn_dark(bg_color = "accent green",
text_color = "white",
banner = TRUE,
banner_color = "gold",
banner_text_color = "accent_green",
banner_alpha = 0.85) +
scale_y_continuous(expand = expansion(mult = c(0.001, 0.01)))
p <- p +
geom_point(color = "#003865", size = 7, alpha = 0.5) +
theme_mn()
p |> add_mn_logo()
p |> add_mn_logo("mdh", logo_width = 0.18)
p |> add_mn_logo("mpca", logo_width = 0.28)
## Dark mode logos
p <- p +
geom_point(color = mn_color("white"), size = 7, alpha = 0.7) +
theme_mn_dark()
p |> add_mn_logo("mpca-inverse", logo_width = 0.28, bg_color = "blue")
Use mn_color("blue")
to get a MN brand color’s HEX code. You can use
the color names in any of the mntheme
functions and they will convert
the names to the HEX code for you.
Example:
plot + theme_mn_dark(text_color = "teal")
You can add an organization’s logo to a plot by passing a logo short
name to add_mn_logo()
.
Example:
plot %>% add_mn_logo("mdh")
NAME | LOGO |
---|---|
horizontal | |
primary | |
primary-inverse | |
mdh | |
mdh-inverse | |
mdh-tall | |
mdh-tall-inverse | |
mpca | |
mpca-inverse |
Contributions welcome! If you’d like to suggest themes or improvements, open an issue or pull request on GitHub.
This package is released under the MIT License.
Built on the shoulders of ggplot2 and hrbrthemes.