Detailed description |
Any rasters plotted, using plot, under a plotting device where layout has been used gives wonky results when the regions are not equal in size.
The following causes regardless of the output device I use:
b = raster(system.file("external/rlogo.grd", package="raster"))
quartz(width=10, height=3)
layout(matrix(1:3,ncol=3), c(0.1,0.3,0.6))
layout.show(3)
quartz(width=10, height=3)
layout(matrix(1:3,ncol=3), c(0.1,0.3,0.6))
par(mar=c(0.5,0.5,0.5,0.5))
plot(b, axes=FALSE)
plot(b, axes=FALSE)
plot(b, axes=FALSE)
The first raster appears to be correctly sized but the legend is incorrect and the grey bounding box is 1/3 the size of the total device area. The second and third rasters are the wrong size, about 1/3 of the device size, but their legend and bounding boxes are properly scaled (to the incorrect size).
I believe that this is similar to an unresolved issue that showed up on the r-help mailing list a couple of months back - https://stat.ethz.ch/pipermail/r-help/2012-March/307114.html. |
|