[R-sig-Geo] image.plot legend problem with layerstack

Carsten Neumann carstennh at aol.com
Fri Oct 22 02:43:41 CEST 2010


  Dear experts,

I simply try to plot an S4 object with a legend using image.plot 
provided by the fields package, but the legend does not occur. I also 
tried the filled.contour function with no succes, either. I wonder 
weather image.plot cannot deal with S4 data to plot a legend. Can anyone 
help me to find out the mistake in my processing steps or is there 
another simple way to create an imagelegend plot of an satellite image 
whithout transfroming it into a matrix (matrix will lose automated 
coordinate allocation to axes in the plot window and data has to be 
loaded into memory).

library(raster)
library(fields)

a1<-stack('layerstack_surf_sub')
d<-colors()
new.pallette <- colorRampPalette( c(d[34], d[142], d[27]) )
image.plot(a1 at layers[[19]],col=new.pallette(255))
?????????
###Error in if (del == 0 && to == 0) return(to) :
###Missing Value, where TRUE/FALSE needed
?????????

The image occur in defined colorscale, but without a legend!

Very Great Thanks in Advance!

Carsten



More information about the R-sig-Geo mailing list