How to print a figure as a PDF, that has the same size of my figure (or, how to resize the PDF according to my figure dimensions)?
7 次查看(过去 30 天)
显示 更早的评论
How to print a figure as a PDF, that has the same size of my figure (or, how to resize the PDF according to my figure dimensions)?
In other words, how can I get rid of the upper and lower white margins in the following printed PDF?
% create a figure with "subtightplot"
subplot = @(m,n,p) subtightplot (m, n, p, [0.001 0], [0.01 0.01], [0.01 0.01]);
fig = figure('position',[700 100 700 1200],'Color',[1 1 1])
hold on
for i = 1 : 6
subplot(2,3,i);
end
hold off
% print the figure as PDF
fig.Units = 'centimeters'; % set figure units to cm
fig.PaperUnits = 'centimeters'; % set pdf printing paper units to cm
fig.PaperSize = fig.Position(3:4); % assign to the pdf printing paper the size of the figure
path = ( '/Users/Donald/.../' ); % where to print my figure
print (fig(:), '-dpdf','-loose','-opengl','-r600', [path, 'fig'] )
This is the resulting PDF, where you can clearly see the upper and lower white margins that I would like to get rid of:
3 个评论
Luca Ferro
2023-3-7
doesn't this have basically the same solution of what you already asked here? Crop white margins in a PDF file - MATLAB Answers - MATLAB Central (mathworks.com)
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!