[R] negative and positive values in diff. colors
Paul Murrell
p.murrell at auckland.ac.nz
Thu Nov 7 20:30:01 CET 2002
Hi
Rado Bonk wrote:
>
> Hi R-users,
>
> I have a set of elevation residuals as geodata points. I would like to
> display them in the following way:
> -negative values using pch=20 (filled circle)
> -positive values using pch=1 (empty circle)
>
> while using the cex.max=5, cex.min=0.1 for points() to represent the
> residuals value. Basically I would like to distinguish neagtive and
> positive values at my map. How to do this.
Do you mean something like this ... ?
x <- rnorm(50)
y <- rnorm(50)
z <- rnorm(50)
pch <- rep(1, 50)
pch[z < 0] <- 20
cex <- (abs(z)/max(abs(z))) * 4.9 + 0.1
plot(x, y, pch=pch, cex=cex)
Paul
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list