Set the xlim/ylim to the extent of the data and then do plot(x1, y1, xlim=range(x1, x2), ylim=range(y1, y2)) points(x2, y2, col='red')
On Wed, Feb 11, 2009 at 3:43 PM, liujb <liujul...@yahoo.com> wrote: > > Dear R users, > > I need to compare two scatter plots, > plot(x1, y1) > plot(x2, y2) > > and would like to plot them in the same figure. How do I do it? > > Thank you. > > -- > View this message in context: > http://www.nabble.com/two-scatter-plots-in-one-tp21963375p21963375.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.