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)?
조회 수: 5 (최근 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!