[R] Multiple line plots

Ales Ziberna ales.ziberna at guest.arnes.si
Wed Jun 15 21:05:46 CEST 2005


assuming that your matrix is named x, try

matplot(x,type="l")

Ales Ziberna

P.S.: see "?matplot" for help to matplot. That it all it took me!


----- Original Message ----- 
From: "Mihai Nica" <m_nica at hotmail.com>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, June 15, 2005 8:50 PM
Subject: [R] Multiple line plots


> Greetings,
>
> I would like to plot three lines on the same figure, and I am lost. There 
> is
> an answer to a similar thread. but I tried matplot and it is beyond me. An
> example of the data follows:
>
> Year EM IM BM
> 1983 9.1 16.8 -7.7
> 1984 12.0 18.0 -6.0
> 1985 13.6 19.1 -5.5
> 1986 12.4 17.3 -4.9
> 1987 14.6 20.3 -5.7
> 1988 20.6 23.3 -2.6
> 1989 25.0 27.2 -2.2
> 1990 28.4 30.2 -1.8
> 1991 33.3 31.2 2.1
> 1992 40.6 35.2 5.4
> 1993 41.6 39.9 1.7
> 1994 50.8 49.5 1.3
> 1995 46.3 61.7 -15.4
> 1996 56.8 73.0 -16.2
> 1997 71.4 85.9 -14.5
> 1998 79.0 94.7 -15.7
> 1999 87.0 109.7 -22.7
> 2000 111.7 135.9 -24.2
> 2001 101.5 131.4 -29.9
> 2002 97.5 134.6 -37.1
> 2003 97.4 138.1 -40.6
> 2004 110.8 155.8 -45.1
>
> Thanks,
>
> Mihai
>
>


--------------------------------------------------------------------------------


> ______________________________________________
> 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