Hi I did not have a look at this when it was sent as I thought it dealt with ggplot objects
If you have trellis objects (check by str())or ?class) try printing them print(p2, position = (c(0,0,1,0.5), more =T) print(p1, position = (c(0,0.5,1,1), more = F) The only other way that I can think of is using viewports ? grid::viewports If it is base graphics then ? layout may fix it Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -----Original Message----- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Agustin Lobo Sent: Thursday, 27 October 2016 23:58 To: r-help@r-project.org Subject: [R] How to create a list of trellis objects for grid.arrange() Given require(raster) require(sp) require(gridExtra) f <- system.file("external/test.grd", package="raster") r <- raster(f) p1 <- spplot(r) p2 <- spplot(r) I would like to plot the equivalent to grid.arrange(p1,p2,ncol=1,nrow=2) but keeping the trellis objects p1 and p2 within one single object (as in practice I have many objects generated within a for() loop). The following used to work: ps <- c(p1,p2) grid.arrange(ps,ncol=1,nrow=2) but does not work any more. How should I combine p1 and p2 into one single object that would be accepted by grid.arrange? Thanks -- Agustin Lobo aloboa...@gmail.com ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.