Tight bounding box around PDF of MATLAB figure
When creating a simple figure in MATLAB and saving it as PDF, the resulting PDF file will have a luxurious bounding box. plot(1,1,'x') print(gcf, '-dpdf', 'test.pdf'); (From the ratio of the output it seems they always put in on an A page.) Is there a simple way to get a tight bounding box around the PDF? You can format the bounding box as follows figure(1) hold on; plot(1,1,'x') ps = get(gcf, 'Position'); ratio = (ps(4)-ps(2)) / (ps(3)-ps(1)) paperWidth = 10; paperHeight = paperWidth*ratio; set(gcf, 'paperunits', 'centimeters'); set(gcf, 'papersize', [paperWidth paperHeight]); set(gcf,