[R] color ranges on a 2D plot

From: dxc13 <dxc13_at_health.state.ny.us>
Date: Wed, 16 Jan 2008 12:35:06 -0800 (PST)

useR's

I am trying to color the points on a scatter plot (code below) with two colors. Red for values 0.5 -1.0 and blue for 0.0 - .49. Does anyone know a easy way to do this?

x <- runif(100, 0, 1)
y <- runif(100, 0, 1)
plot(y ~ x, pch=16)

Thanks,
dxc13

-- 
View this message in context: http://www.nabble.com/color-ranges-on-a-2D-plot-tp14893457p14893457.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Wed 16 Jan 2008 - 20:45:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jan 2008 - 15:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive