[R] plotting multiple series in one plot

Dimitris Rizopoulos dimitris.rizopoulos at med.kuleuven.ac.be
Fri Nov 26 16:11:58 CET 2004


Hi Zack,

you mean something like:

matplot(x$a, as.matrix(cbind(x$b, y$b)), lty=1:2, type="l")
legend(1, 2.5, c("b.x", "b.y"), lty=1:2, col=1:2)


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Apoian, Zack" <Zack.Apoian at sac.com>
To: "'R-help at lists.R-project.org'" <R-help at stat.math.ethz.ch>
Sent: Friday, November 26, 2004 3:34 PM
Subject: [R] plotting multiple series in one plot


> say we have:
>
>> x<-data.frame(a=c(1,2,3,4,5),b=c(1,1,1.5,2,2))
>> y<-data.frame(a=c(1,2,3,4,5),b=c(1,2,2,3,3))
>
> How would I plot this so that, with the shared $a as the x-axis 
> values, I
> have both $b columns plotted together?  (a comparison of the two?)
>
> thanks.
>
>
> DISCLAIMER: This e-mail message and any attachments are 
> inte...{{dropped}}
>
> ______________________________________________
> R-help at 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
>




More information about the R-help mailing list