Skip to content
Back to formatted view

Raw Message

Message-ID: <3DCABF39.11DB3C5F@stat.auckland.ac.nz>
Date: 2002-11-07T19:30:01Z
From: Paul Murrell
Subject: negative and positive values in diff. colors

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._