Skip to content

Instantly share code, notes, and snippets.

@emhart
Last active December 22, 2017 07:56
Show Gist options
  • Save emhart/4688149 to your computer and use it in GitHub Desktop.
Save emhart/4688149 to your computer and use it in GitHub Desktop.
A blank ggplot2 theme
theme.blank = function(size=12) {
theme(
#axis.line=element_blank(),
axis.text.x=element_text(size=size),
axis.text.y=element_text(size=size),
#axis.ticks.y=element_text(size=size),
# axis.ticks=element_blank(),
axis.ticks.length=unit(0.1, "lines"),
axis.ticks.margin=unit(0.5, "lines"),
axis.title.x=element_text(size=size*1),
axis.title.y=element_text(size=size*1,angle=90),
legend.background=element_rect(fill="white", colour=NA),
legend.key=element_rect(colour="white",fill="white"),
legend.key.size=unit(1.2, "lines"),
legend.text=element_text(size=size),
legend.title=element_text(size=size, face="bold",hjust=0),
strip.background = element_rect(colour = "black", fill = 'white', size = .5),
panel.background=element_rect(fill="white",colour="black"),
# panel.border=element_blank(),
panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
panel.margin=unit(0, "lines"),
plot.background=element_blank(),
plot.margin=unit(c(1, 1, 0.5, 0.5), "lines"),
plot.title=element_text(size=size*1.2),
strip.text.y=element_text(colour="black",size=size,angle=270),
strip.text.x=element_text(size=size*1))}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment