Here is an example doing the same type of thing. It should be easy enough to adapt.
Good luck =========================================================== x <- runif(100, 0, 1) y <- runif(100, 0, 1) z <- data.frame(x,y) plot(subset(z, z$y >=.5), col="red", ylim=c(min(z$y), max(z$y)), pch=16) points(subset(z, z$y <=.49), col="blue", pch=16) =========================================================== --- On Fri, 9/5/08, Steve Murray <[EMAIL PROTECTED]> wrote: > From: Steve Murray <[EMAIL PROTECTED]> > Subject: [R] Use of colour in plots > To: r-help@r-project.org > Received: Friday, September 5, 2008, 9:10 AM > Dear all, > > I have 3 datasets all of which share the same longitude and > latitude values, which I'm looking to plot onto a > scattergraph. The third dataset has values which can only be > either '1' or '2'. So to incorporate all > three datasets onto two axes, I'm wondering if I can > plot dataset1 and dataset2 as normal, but then use colour to > determine whether these points are either values '1' > or '2' according to the third dataset. > > If so, how would I go about doing this in R, and what > format would the command take? > > Thanks for any help offered, > > Steve > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, > reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.