saving figure with minimal white space without ballooning the size

조회 수: 12 (최근 30일)
Barbara Margolius
Barbara Margolius 2025년 10월 6일 18:08
댓글: Barbara Margolius 2025년 10월 7일 2:10
I saved a file with
set(gca, 'LooseInset', get(gca, 'TightInset'));
set(gcf, 'PaperPositionMode', 'auto');
saveas(gcf, filename, 'epsc');
but it had too much white space. It was 1.2mb in size.
So I saved it with
exportgraphics(gcf, filename, 'ContentType', 'vector', 'Padding', 0);
This resolved the white space issue, but it was 79mb in size.
Is there a way to save the figure without the huge jump in file size? I am trying to save a complex phase portrait. I want to save several of them, so I don't want to have to do the cropping in an external program. Thanks.
  댓글 수: 2
xingxingcui
xingxingcui 2025년 10월 7일 1:40
Your complex phase portrait is graphic or image type?
Barbara Margolius
Barbara Margolius 2025년 10월 7일 2:10
I'm sure you have identified the problem. I adapted some code from file exchange to generate my image and presumably it is raster rather than vector. Thanks.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by