Tightly cropped PDF (programatically not intereacitvely)

I know it is possible to interactively save a figure as a PDF that is tighlty cropped around the axes content using the export button, as described here:
I would like to ask though, how can we achieve the exact same tight cropping programatically? I tried using the below code but it did not have the same effect:
set(gcf,'Units','inches');
screenposition = get(gcf,'Position');
set(gcf,...
'PaperPosition',[0 0 screenposition(3:4)],...
'PaperSize',[screenposition(3:4)]);

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2020년 2월 21일

답변:

2020년 2월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by