I’m trying to save a figure in PDF format such that I don’t get extraneous white space around it, i.e. the figure should be the same size as the figure window.
I’m pretty sure that the way to do it is
figureNames = {'a', 'b', 'c'};
for i = 1:3
set(figure(i), 'paperpositionmode', 'auto');
print(figure(i), '-dpdf', figureNames{i})
end
But it’s not working. I’m getting as much white space as ever. Can someone enlighten me as to what’s wrong?
You can try “all in one” solutions for converting figures to pdf-files. I use mlf2pdf
(http://www.mathworks.com/matlabcentral/fileexchange/28545) and it seems to work quite well. Moreover, the quality of the produced figures is much better due to Latex typesetting of everything