Skip to content

Plot of multiple data sets

2 messages · Stéphane Mattei, Romain Francois

#
Thank you all for your answers.

I eventually use the points command

plot(MATRIX[,1])
points(MATRIX[,2])
points(MATRIX[,3])
...

with matplot I had numbers instead of points with type="p" and par(new=TRUE) makes complications
with the axis.
#
Le 07.09.2005 16:00, St??phane Mattei a ??crit :
So, add pch=21 or something else to your matplot call and you won't need 
an extra package for that.

R> matplot(iris[,1:4], type="p", pch=21)

Also, if you want to do it with plot and points, you must specify the y 
range like that :

R> plot(MATRIX[,1], ylim=range(MATRIX))
R> points(MATRIX[,2])
R> points(MATRIX[,3])

Proceeding that way, par(new=TRUE) won't make complications anymore.

Romain