Dear All Subject : Multiple Lines in Graph Could you please help me to draw two lines in a graph. plot(f1, t1, type ="b") and plot(f2,t2, type="b") where t1, t2, f1,and f2 are single dimensional matrix. I have these two graph. How can I draw these two lines in a single window? Thanks in advance Kind Regards Wesley C Mathew [[alternative HTML version deleted]]
Hi r-help-bounces at r-project.org napsal dne 05.02.2010 11:13:23:> Dear All > > Subject : Multiple Lines in Graph > > Could you please help me to draw two lines in a graph. > plot(f1, t1, type ="b") and plot(f2,t2, type="b") where t1, t2,f1,and f2> are single dimensional matrix.With your example I get this error> plot(f1, t1, type ="b")Error in plot(f1, t1, type = "b") : object 'f1' not found>So without actual knowledge about f1, t1 and f2, t2 the only possible help is ?line ?points Regards Petr> I have these two graph. How can I draw these two lines in a singlewindow?> Thanks in advance > > Kind Regards > Wesley C Mathew > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
On 02/05/2010 09:13 PM, wesley mathew wrote:> Dear All > > Subject : Multiple Lines in Graph > > Could you please help me to draw two lines in a graph. > plot(f1, t1, type ="b") and plot(f2,t2, type="b") where t1, t2, f1,and f2 > are single dimensional matrix. > I have these two graph. How can I draw these two lines in a single window?Hi Wesley, plot(f1,t1,type="b") lines(f2,t2,type="b") Note that if the ranges of f1 and f2 or t1 and t2 are different, you will need to set xlim or ylim respectively. Jim
Wesley, As has already been pointed out, it's a good idea to provide _reproducible_ code. I'll just add that it's also a good idea to peruse the help pages, where you would find that ?plot points you to ?lines (under See Also). Making frequent use of the help pages is pretty well an R-requirement. -Peter Ehlers wesley mathew wrote:> Dear All > > Subject : Multiple Lines in Graph > > Could you please help me to draw two lines in a graph. > plot(f1, t1, type ="b") and plot(f2,t2, type="b") where t1, t2, f1,and f2 > are single dimensional matrix. > I have these two graph. How can I draw these two lines in a single window? > Thanks in advance > > Kind Regards > Wesley C Mathew > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > >-- Peter Ehlers University of Calgary