In the meanwhile, I found a more minimal example which shows the problem (just change 'inch' to TRUE to see the difference):
require(grid) inch <- FALSE # TRUE d <- if(inch) 5 else 1 pspc <- d*c(0.3, 0.3) # width, height of panels spc <- d*c(0.05, 0.05) # width, height of space axlabspc <- d*c(0.1, 0.1) # width y label, height x label labspc <- d*c(0.05, 0.05) # width label boxes, height label boxes par. <- par(no.readonly=TRUE) gl <- grid.layout(5, 5, default.units=if(inch) "inches" else "npc", widths=c(axlabspc[1], pspc[1], spc[1], pspc[1], labspc[1]), heights=c(labspc[2], pspc[2], spc[2], pspc[2], axlabspc[2])) grid.show.layout(gl) pushViewport(viewport(layout=gl)) for(i in 1:2) { for(j in 1:2) { pushViewport(viewport(layout.pos.row=2*i, layout.pos.col=2*j, name="foo")) grid.rect() upViewport() } } par(par.) ______________________________________________ R-help@r-project.org mailing list 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.