Skip to content

Instantly share code, notes, and snippets.

@privefl
Last active March 5, 2018 14:05
Show Gist options
  • Save privefl/5a66f89b8b32e32983069d5d09d2fdff to your computer and use it in GitHub Desktop.
Save privefl/5a66f89b8b32e32983069d5d09d2fdff to your computer and use it in GitHub Desktop.
MY_THEME <- function(p, coeff = 1) {
p + theme_bw() +
theme(plot.title = element_text(size = rel(2.0 * coeff), hjust = 0.5),
plot.subtitle = element_text(size = rel(1.5 * coeff), hjust = 0.5),
legend.title = element_text(size = rel(1.8 * coeff)),
legend.text = element_text(size = rel(1.3 * coeff)),
axis.title = element_text(size = rel(1.5 * coeff)),
axis.text = element_text(size = rel(1.2 * coeff)),
legend.key.height = unit(1.3 * coeff, "line"),
legend.key.width = unit(1.3 * coeff, "line"))
}
myggplot <- function(..., coeff = 1) {
MY_THEME(ggplot2::ggplot(...), coeff = coeff)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment