Re: [R] plot two graphs with different length of data

From: Eric Hu <list.eric_at_gmail.com>
Date: Fri 16 Jun 2006 - 08:33:31 EST

thank you, Joerg. I am able to use points() to add the new data in the current plot.

Eric

On 6/13/06, Joerg van den Hoff <j.van_den_hoff@fz-rossendorf.de> wrote:
> Eric Hu wrote:
> > Hi I am trying to plot two data set in the same picture window without
> > overlapping with each other. I am using the format plot(x1,y1,x2,y2)
> > but get the following error message:
> >
> >> plot(as.numeric(r0[,4]),as.numeric(r0[,7]),as.numeric(r0[,4]),as.numeric(r0[,7][ind[,1]]))
> > Error in plot.window(xlim, ylim, log, asp, ...) :
> > invalid 'ylim' value
> >
> > Can anyone tell me what went wrong? Thanks.
> >
> > Eric
> >
> > ______________________________________________
> > R-help@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
>
>
> matplot(cbind(x1,x2), cbind(y1,y2)) might be what you want.
>
> (if x1, x2 and y1,y2 are of equal length. otherwise pad the short ones
> with NAs or use `matplot' with type =n (to get the scaling of the plot
> right), followed by `plot(x1,y1), lines(x2,y2)')
>



R-help@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 Received on Fri Jun 16 08:39:04 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 16 Jun 2006 - 10:12:55 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.