[R] How to Plot Two Curves Into One Page

Gundala Viswanath
Tue, 01 Feb 2011 05:20:51 -0000

I have a R script that contain these lines for plotting:

plot(foo,lwd=2,lty=3,col="red", main="");
plot(bar,lwd=2,lty=3,col="blue");
legend(0.6,0.6,c('Default','Probabilistic'),
col=c('red','blue'),lwd=3);


But it generate 1 file (Rplot.pdf) with two pages. Each page for 1 plot.
Is there a way I can put them together in to one page?

- G.V.