[R] multiple series on same graph

Joerg Maeder maeder at atmos.umnw.ethz.ch
Wed Jan 30 09:38:33 CET 2002


Hello Collin,

The thing with different colors, symbols or size is very easy. Just give
a vector with as many elements as points you want to the function
points.

points(c(x1,x2,x3,x4,x5),c(y1,y1,y2,y3,y4,y5),col=c(col1,col2,col3,col4,col5),phc=(pch1,pc...),cex=c(....))

the same thing also works in plot, text, lines and so on, and also for
the arguments lty (line typ)
If your vector is too short it will be duplicated as many time as
neccessary. In this case col=c('black','blue') will produce alternating
colors.

with legends i don't have much experience. I often do it with 'text' and
'points'. But there is a function called legend. I should also have to
look to it.

gruess 

joerg 

Collin Carbno wrote:
> 
> I'm trying to duplicate some graphs from powerpoint in R package.  One
> of things I'm having trouble with is I don't understand how to use the
> points command to create different sets of points with different color
> and marking attributes, and a legend on the graph.  Where should I look?
> I can't seem to find an example of two different sets of data on the
> same graph.
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
Joerg Maeder    .:|:||:..:.||.::   maeder at atmos.umnw.ethz.ch
Tel: +41 1 633 36 25   .:|:||:..:.||.::   
http://www.iac.ethz.ch/staff/maeder
PhD student at INSTITUTE FOR ATMOSPHERIC AND CLIMATE SCIENCE (IACETH)
ETH ZÜRICH Switzerland
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list