Simply use the col paramater, with a factor to index the colors. 

Example: 
# generate some data
x <- rnom(100)
y <- rnorm(x)
z <- as.factor(rbinom(x,1,0.5))

# plot
plot(x,y, col=c('red','blue')[z])

HTH, 

Matthieu

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

Reply via email to