Skip to content

plotting two variables with a third used for color

1 message · Jo Frabetti

#
On 2009-March-20 , at 16:23 , David Winsemius wrote:

            
And you could look into the package ggplot2 which gives you a legend  
and is well suited for these things.

# quick version:
qplot(wV[0:15,3], wY[0:15,3], colour=ifelse(wY[0:15,3]>0,">0","<0"))

# more explicit version, using a data.frame
dat = data.frame(v=wV[0:15,3], y=wY[0:15,3],  
sign=ifelse(wY[0:15,3]>0,">0","<0"))
ggplot(data=dat) + geom_point(aes(x=v,y=y,colour=sign))

JiHO
---
http://jo.irisson.free.fr/