SCM

[#5032] problem plotting raster with colortable

Date:
2013-10-31 01:57
Priority:
3
State:
Open
Submitted by:
Patrick Brown (patrick)
Assigned to:
Nobody (None)
Hardware:
None
Product:
None
Operating System:
Linux
Component:
None
Version:
None
Severity:
minor
Resolution:
None
URL:
Summary:
problem plotting raster with colortable

Detailed description
Hello. When plotting a raster with a @legend@colortable, an empty plot is produced before the main plot appears.

The following produces a single plot, in the left pane

myraster = raster(matrix(rep(1:4, 4), 4))
par(mfrow=c(1,2))
plot(myraster)

whereas the code below produces an empty plot in the left pane before putting the desired plot in the right pane

myraster@legend@colortable = rainbow(5)
par(mfrow=c(1,2))
plot(myraster)

changing the useRaster option doesn't help. I'm using
Package raster version 2.1-49, R 3.0.2


A way around this problem is to do
plot(extent(myraster), asp=TRUE)
plot(myraster, add=TRUE)

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