[R] Multiple lines in a graph

Jim Lemon jim at bitwrit.com.au
Fri Feb 5 11:24:53 CET 2010


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



More information about the R-help mailing list