-
-
Save raivivek/fd04b391d9ea5cea92537d6c243ac1fb to your computer and use it in GitHub Desktop.
ggplot2 theme for publication figures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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