SCM

[#2304] plot raster is incompatible with devices using layout

Date:
2012-10-09 22:45
Priority:
3
State:
Open
Submitted by:
Colin Rundel (crundel)
Assigned to:
Nobody (None)
Hardware:
Macintosh
Product:
None
Operating System:
MacOS X
Component:
None
Version:
None
Severity:
None
Resolution:
None
URL:
Summary:
plot raster is incompatible with devices using layout

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.

Comments:

No Comments Have Been Posted

Attached Files:

Changes

No Changes Have Been Made to This Item

Thanks to:
Vienna University of Economics and Business Powered By FusionForge