Re: [R] R-help Digest, Vol 35, Issue 7

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Sun 08 Jan 2006 - 03:09:41 EST

Evgeniy Kachalin wrote:

> Hello, dear participants!
>
> Could you tip me, is there any simple and nice way to build scatter-plot
> for three different types of data (, and o and * - signs, for example)
> with legend.
>
> Now i can guess only that way:
>
> plot(x~y,data=subset(mydata,factor1=='1'), pch='.',col='blue')
> points(x~y,data=subset(mydata,factor1=='2'), pch='*',col='green')
> points(.... etc
>
> What is the simple and nice way?
> Thank you very much for your kindness and help.
>

Example:

with(iris,

   plot(Sepal.Length, Sepal.Width, pch = as.integer(Species))) with(iris,

   legend(7, 4.4, legend = unique(as.character(Species)),

                     pch = unique(as.integer(Species))))


Uwe Ligges



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jan 08 03:19:24 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:55 EST