- Figure without border (asked less than 24 hours ago)
- Save plot with minimal whitespace
- How to remove the white blank area
Save Plot with Minimal White Space (Crop Padding)
조회 수: 45 (최근 30일)
이전 댓글 표시
I'd like to save my figures without the rather large white padding space that Matlab includes by default, and such that they are as tightly cropped as possible.
This page seems to include both a script/programatic way to do it as well as a GUI-based one; unfortunately, it seems to not work in my version (R2016a).
Is there any workaround that can help me achieve the same goal?
Thanks!
댓글 수: 2
Adam Danz
2019년 7월 11일
Also see the solutions to these similar questions
채택된 답변
Adam Danz
2019년 7월 11일
편집: Adam Danz
2019년 7월 11일
"What isn't working: there is no export button as explained on that page..."
The demo in the link you provided works well in r2019a and r2016b (those are the releases I tested).
r2019a
Hover your mouse over the axes and a row of icons should appear in the upper, right corner, one of which is the export button.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/228618/image.jpeg)
If that's not working in r2019a, make sure toolbar visibility is on.
axh = gca();
axh.Toolbar.Visible = 'on';
r2016b
From the menu bar, select File > Export Setup.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/228619/image.jpeg)
Turn on the menu bar if it's not visible.
fh = gcf();
fh.MenuBar = 'Figure';
Alternatively, do it programmatically.
Follow the steps in the link you proivded to do it without the export button.
"1) Those 2 lines of code did not work for me..."
Again, what didn't work? I'm sure it didn't result in an error.
댓글 수: 2
ZAHID RAZZAQ
2021년 3월 1일
Thanks so much it worked for me. I am using Matlab R2020b, this was exactly I was looking for , it also doesn't distort the quality of plot. Thanks once again.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!