Created
March 2, 2015 20:21
-
-
Save conorsg/54f99d46206301f74169 to your computer and use it in GitHub Desktop.
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
buildChart <- function(p) { | |
gt <- ggplot_gtable(ggplot_build(p)) | |
t <- gtable_filter(gt, "title")[[1]] | |
l <- gtable_filter(gt, "guide-box")[[1]] | |
p <- p + theme(legend.position = "none", plot.title = element_blank()) | |
built <- grid.arrange( | |
arrangeGrob( | |
t[[1]], | |
l[[1]], | |
p, | |
nrow = 3, | |
heights = c(1, 1.2, 10) | |
) | |
) | |
return(built) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment