Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. buildChart <- function(p) {
  2.  
  3. gt <- ggplot_gtable(ggplot_build(p))
  4.  
  5. t <- gtable_filter(gt, "title")[[1]]
  6.  
  7. l <- gtable_filter(gt, "guide-box")[[1]]
  8.  
  9. p <- p + theme(legend.position = "none", plot.title = element_blank())
  10.  
  11. built <- grid.arrange(
  12. arrangeGrob(
  13. t[[1]],
  14. l[[1]],
  15. p,
  16. nrow = 3,
  17. heights = c(1, 1.2, 10)
  18. )
  19. )
  20.  
  21. return(built)
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement