Controlling the internal shape limit in grid.layout

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?

+4
source share
1 answer

lattice provides some options for managing chart fields,

  p <- xyplot(1:10~1:10, par.settings=list(layout.heights=list(top.padding=-3, bottom.padding=-1))) library(gridExtra) grid.arrange(p, p, nrow=2) 
+4
source

Source: https://habr.com/ru/post/1391141/


All Articles