[R] multiple plot overlay - dataframe

Petr Pikal petr.pikal at precheza.cz
Wed Feb 26 08:10:25 CET 2003


Hi

On 25 Feb 2003 at 22:41, Hi from Zynnel wrote:

> I hope you could help me with this. I have a dataframe
> with 5 columns, the first column determining the X
> values, and the rest four determining four separate Y
> vectors. How can I plot them on the same graph,
> overlaying each other?
It depends little bit on range of your Y values. If it is similar magnitude, then 
simple

matplot(your.df[,1],your.df[,3:6],type="l")

see
?matplot

will do it. But if the range of your Y values is big you have to do some 
"flattening" or to use subsequent plot commands with par(new=T).

See
?plot and ?par

> Thanks.
> 
> Elena Zheleva
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Cheers.Petr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz




More information about the R-help mailing list