-----Oorspronkelijk bericht-----
Van: Edzer J. Pebesma [mailto:e.pebesma at geo.uu.nl]
Verzonden: woensdag 14 maart 2007 13:40
Aan: ONKELINX, Thierry
CC: r-sig-geo at stat.math.ethz.ch
Onderwerp: Re: [R-sig-Geo] Plotting data with multiple
symbols and colours
I would try the alternative,
bubble(Error,maxsize=1.5)
bubble(Error,maxsize=1.5, key.entries=-10:10)
Doing what you want with spplot, you're basically thrown back
at xyplot with asp="iso"; look at how key is formed there; with
spplot(Error, pch = ifelse(Error$error < 0, 95, 3), key.space
= "right", cuts = -10:10)
I get funny pch changes in the key. I think that spplot
passes an optional key argument to xyplot.
--
Edzer
ONKELINX, Thierry wrote:
Dear listeRs,
We're trying to create a map with interpolation errors of
data. The idea is to plot the errors at the location of the
a "+" or "-" symbol to indicate whether they are positive
and a colour ramp that indicates the magnitude of the
we managed to get a plot with the correct symbols. But the
only works for the positive errors. The code to generate this:
library("sp")
library("RColorBrewer")
library("lattice")
set.seed(1)
Error <- SpatialPointsDataFrame(matrix(runif(1000), ncol =
data.frame(error = runif(500, -10, 10)))
trellis.par.set(sp.theme(set
= FALSE, regions = list(col = c(rainbow(50, start = 0, end = 4/6),
rev(rainbow(50, start = 0, end = 4/6))))))
spplot(Error[Error$error >=
0, ], zcol = "error", sp.layout = list("sp.points",
< 0, ], pch = 95), key.space = "right", cuts = seq(-10, 10,
21), pch = 3)
The questions:
1. For do we set the colour ramp for the negative values?
2. Can we change the key so it displays only absolute
front of the negative values?
All help is welcome.
Thierry
----------------------------------------------------------------------
--
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Reseach Institute
and Forest Cel biometrie, methodologie en kwaliteitszorg / Section
biometrics, methodology and quality assurance Gaverstraat 4 9500
Geraardsbergen Belgium tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be
Do not put your faith in what statistics say until you have
considered what they do not say. ~William W. Watt A statistical
analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney