Skip to content

Instantly share code, notes, and snippets.

@raivivek
Forked from wpetry/theme_ms.R
Created June 12, 2018 19:56
Show Gist options
  • Save raivivek/fd04b391d9ea5cea92537d6c243ac1fb to your computer and use it in GitHub Desktop.
Save raivivek/fd04b391d9ea5cea92537d6c243ac1fb to your computer and use it in GitHub Desktop.
ggplot2 theme for publication figures
library(ggplot2)
library(grid)
# define consistent ggplot theme to apply to all figures
theme_ms <- function(base_size=12, base_family="Helvetica") {
library(grid)
(theme_bw(base_size = base_size, base_family = base_family)+
theme(text=element_text(color="black"),
axis.title=element_text(face="bold", size = rel(1.3)),
axis.text=element_text(size = rel(1), color = "black"),
legend.title=element_text(face="bold"),
legend.text=element_text(face="bold"),
legend.background=element_rect(fill="transparent"),
legend.key.size = unit(0.8, 'lines'),
panel.border=element_rect(color="black",size=1),
panel.grid=element_blank()
))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment