spplot grid data - scale colours customizing
On 08/03/2015 09:41 AM, pierluigi de rosa wrote:
Dear All,
I'm trying to understand how spplot work with colour managing with gridded
data.
I have na Object of class SpatialGridDataFrame
Coordinates:
min max
x 2267600 2325600
y 4693800 4826200
Is projected: TRUE
proj4string :
with 12 data for column attribute
I'm able to plot the SpatialGridDataFrame with:
spplot(fogli_Sup_Pioggia,as.table=TRUE, col.regions = cm.colors(100) ,
key.space = "right")
but I want to select where change in colour appears and not leave spplot to
do it by it self.
I tried passing cuts option in this way:
spplot(fogli_Sup_Pioggia,as.table=TRUE, col.regions = cm.colors(100) ,
cuts=c(1,2.5,3),key.space = "right")
It seems working but now the colour is not graduated any more but.
How can I have a graduated palette again?
Thanks
this gave you a warning, which you didn't report. Use cuts=5 to get 5 classes; use at=c(1,2.5,3) to get colour changes at these values. And do read ?spplot.
Edzer Pebesma Institute for Geoinformatics (ifgi), University of M?nster, Heisenbergstra?e 2, 48149 M?nster, Germany; +49 251 83 33081 Journal of Statistical Software: http://www.jstatsoft.org/ Computers & Geosciences: http://elsevier.com/locate/cageo/ Spatial Statistics Society http://www.spatialstatistics.info -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: OpenPGP digital signature URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150810/13bde4e9/attachment.bin>