I am trying to build several grid graphs in a grid. For this, I use the following code:
plot <- xyplot(1:10~1:10) page.layout <- grid.layout(nrow = 2, ncol = 1, widths = unit(c(1), "null"), heights = unit(c(1), "null"), default.units = "null", respect = FALSE, just = "centre") pushViewport(viewport(layout = page.layout)) pushViewport(viewport(layout.pos.row = 1)) par(mar = c(5, 4, 4, 2)) print(plot, newpage = FALSE) popViewport() pushViewport(viewport(layout.pos.row = 2)) par(mar = c(5, 4, 4, 2)) print(plot, newpage = FALSE) popViewport()
Now, I would like to reduce the space between the two shapes, I read in the gridBase vignette that simple graphical controls like par (mar=c()) should work, but this is not here. Maybe I am missing something obvious, but I canβt understand why I canβt control the field parameters. Any suggestions?
source share