[R-sig-Geo] specifying different colors for vector map as background
Jaime Carrera
jaime.carrera at ipicyt.edu.mx
Thu Jul 31 20:56:14 CEST 2008
Hi,
I'm trying to create a spplot with a vector map on the background. It
works fine if I don't want the polygon map to be filled, but what I do
want to is to have the polygons filled with different colors. The
following command plots the polygon map fine, filling each polygon with
its respective color:
plot(avi,axes=FALSE,lty=0,col=rgb(avi$r/255,avi$g/255,avi$b/255))
Now I try to do this on ssplot, but it doesn't work, as all polygons are
filled with the first color found:
basemap<-list("sp.polygons",avi,fill=rgb(avi$r/255,avi$g/255,avi$b/255),lty=1)
spplot(wells2001sp,c("May","Jun"),as.table=TRUE,sp.layout=list(basemap))
Is there a way around it?
Thanks,
Jaime
More information about the R-sig-Geo
mailing list