If I print a plot in EPS format, the content of the EPS file is fully occupied with the plot. But if I print a plot in PDF 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?
My guess is how to automatically choose the proper "paper" size in a PDF file to print to, according to the plot size.
This is a question I have asked at tex.stackexchange.com, where I have got replies which mostly tried to solve the problem outside MATLAB, 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.