#' Common Theme
#'
#' Custom theme, shortcut to presentation-quality figures
#' @return ggplot object
#' @import ggplot2
#' @export
theme_common <- function() {
theme_minimal() %+replace%
theme(
axis.text.x = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.title.x = element_text(margin = margin(4, 4, 4, 4), size = 16),
axis.title.y = element_text(margin = margin(4, 4, 4, 4), size = 16, angle = 90),
legend.title = element_text(size = 16),
legend.text = element_text(size = 12),
strip.text.x = element_text(size = 12),
strip.text.y = element_text(size = 12),
panel.grid.major = element_line(color = "grey90"),
panel.grid.minor = element_line(color = "grey90"),
aspect.ratio = 4 / 4,
plot.margin = unit(c(t = +0, b = +0, r = +0, l = +0), "cm"),
plot.title = element_text(size = 18, hjust = 0),
plot.title.position = "plot",
plot.subtitle = element_text(size = 16, hjust = 1),
plot.caption = element_text(size = 12, hjust = 1)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.