On Fri, Oct 3, 2008 at 2:10 PM, kerfuffle <[EMAIL PROTECTED]> wrote:
>
> hi folks,
>
> this is driving me up the wall.  Apologies for posting twice in the same
> week, I'm writing up a thesis.  I wish to color-code some dots in an xy
> plot.  I've got a csv file with various elements, one of which is the
> color-key (with the header 'color').  If the color-key is decimal (eg.
> 1,2,3) then I can use
> plot (X ~ Y, col=data$color)

You might want to try using ggplot2 instead:

install.packages("ggplot2")
library(ggplot2)
qplot(Y, X, data=data, colour = color)

That will automatically pick a nice colour scale for you and draw a
legend.  You can see some examples of
http://had.co.nz/ggplot2/geom_point.html

Hadley

-- 
http://had.co.nz/

______________________________________________
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