khazaei at ceremade.dauphine.fr
2010-Feb-10 10:17 UTC
[R] How to plot three graphs on one single plot?
Hello alla I have three kinds of information (x,y1),(x,y2),(x,y3) such that x and y1,y2,y3 are the vectors with the same dimention. Now I want to plot these three class af information on one plot. thank you for your help. khazaei
?lines plot(...) lines(...) lines(...) On Wed, Feb 10, 2010 at 5:17 AM, <khazaei at ceremade.dauphine.fr> wrote:> Hello alla > > I have three kinds of information (x,y1),(x,y2),(x,y3) such that x and > y1,y2,y3 are the vectors with the same dimention. > Now I want to plot these three class af information on one plot. > thank you for your help. > khazaei > > ______________________________________________ > R-help at 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
On 02/10/2010 09:17 PM, khazaei at ceremade.dauphine.fr wrote:> Hello alla > > I have three kinds of information (x,y1),(x,y2),(x,y3) such that x and > y1,y2,y3 are the vectors with the same dimention. > Now I want to plot these three class af information on one plot. > thank you for your help. > khazaei >Hi khazaei, Try this: matplot(x,cbind(y1,y2,y3),type="l") text(rep(x,3),c(y1,y2,y3),rep(c("y1","y2","y3"),each=16), col=rep(1:3,each=16)) Jim