Matlab Cropping Plots to remove whitespace
3 次查看(过去 30 天)
显示 更早的评论
I want to adjust the amount of whitespace that is shown when plots are generated. I found this command to do just that:
set(gca,'LooseInset',get(gca,'TightInset'))
But this doesn't work that well when I add axis labels. When I have a plot without axis labels it's fine, it looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161371/image.bmp)
But when I add labels it does this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161387/image.bmp)
You can't see it all that well but there is a lot of white space left of the yaxis label. I want to crop it down to the bare minimum, how do I do it?
0 个评论
采纳的回答
lvn
2014-4-20
On the fileexchange there are a lot of functions out there that can do this for you. I use for instance spaceplots http://www.mathworks.com/matlabcentral/fileexchange/35464-spaceplots , which you should call after your figure is complete (with axis labels and all). That function modifies white space between subplots but also left top bottom and right of the whole figure (which is what you want).
0 个评论
更多回答(1 个)
Marc Jakobi
2016-9-15
I just finished working on a function that attemts to automatically solve this problem (without messing up colorbars, labels, etc.)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!