title: automatically adjust R plot size in a PDF output
body: <p>When using the <code>pdf()</code> function in R for saving a plot in an external file, we can specify <code>width</code> and/or <code>height</code> to adjust the size of the plot. However, there are situations when we obtain multiple plot (say using <code>par(mfrow=c(2,4))</code>). In this situation, it's kind of difficult to determine what is the best <code>width</code> and <code>height</code> for the PDF file in order to have all plots displayed properly. Is there a way to let R automatically "fit the plots" in the PDF file? I searched the arguments in <code>pdf()</code> and tried some, but the results are not satisfactory. Thank you very much!</p>