[R] gridExtra-arrangeGrob

Felipe Carrillo mazatlanmexico at yahoo.com
Mon Jan 9 07:06:57 CET 2017


 Hi;The code below used to work on my older version of gridExtra but doesn't work with the new version. Could someonegive me a hint on how to translate this code to the new version of gridExtra code? Thank you beforehand.
p1 <- ggplot(iris,aes(Sepal.Length,  Petal.Length, colour=Species)) +
geom_point() + theme_bw() + theme(legend.position='top')

 grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .33,.33), ncol=1), ncol=2)
 #Create 2 columns with different width using the 'widths' argument in the grid.arrange call
  grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .40,.27), ncol=1), ncol=2,widths=c(1.25,0.75))
p <- rectGrob()  
 grid.arrange(p, arrangeGrob(p,p,p, heights=c(0.33, .33,.33), ncol=1), ncol=2)

	[[alternative HTML version deleted]]



More information about the R-help mailing list