title: How to save a plot into a PDF file without a large margin around
body: <p>If I print a plot in <a href="http://en.wikipedia.org/wiki/Encapsulated_PostScript" rel="noreferrer">EPS</a> format, the content of the EPS file is fully occupied with the plot. But if I print a plot in <a href="http://en.wikipedia.org/wiki/Portable_Document_Format" rel="noreferrer">PDF</a> format, then there are big margins above and below the plot in the PDF file. How can I save a plot in a PDF file without the big margin around the plot?</p>
  
  <p>My guess is how to automatically choose the proper "paper" size in a PDF file to print to, according to the plot size.</p>
  
  <p>This is a question I have asked at <a href="https://tex.stackexchange.com/questions/5559/how-to-avoid-large-margins-around-matlab-plot-in-pdf">tex.stackexchange.com</a>, where I have got replies which mostly tried to solve the problem outside <a href="http://en.wikipedia.org/wiki/MATLAB" rel="noreferrer">MATLAB</a>, and I still don't quite understand the only reply that tried to solve from within MATLAB. So I would like to see if there are more opinions here.</p>