If I understand your question, to superimpose two lines in a same plot, in the first call to plot() you want to set the plot(ylim) argument with a range that will fit both of your lines. Then use lines() to add the second lowess line on the plot. Or matplot() will automate the process for you.
Take a look at savePlot() to save your final figure. Francisco >From: Wei Qiu <[EMAIL PROTECTED]> >To: [email protected] >Subject: [R] How to plot two dataset in one fig? >Date: Fri, 18 Nov 2005 16:38:48 -0500 (EST) > >Hi all, > >I am new in R tool. I would like to plot two dataset in in fig. > >Here is what I did for both a and b data sets > >jpeg(file="a.jpeg") >dat<-read.table('a', header=F, sep=',') >dim(dat) >y<-dat[,1] >y<-y[!is.na(y)] >plot(y);lines(lowess(y, f=0.05), col = >("red"), lwd=5) >dev.off > >Two questions: >1. How I can save this lowess smooth data? >2. Once I have the smooth a and b data, How I can put two smooth data sets >in one fig even they have different Y ranger value? > >Any input will be greatly appreciated. > >Lucy > >______________________________________________ >[email protected] mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
