Matlab Cropping Plots to remove whitespace

8 ビュー (過去 30 日間)
Adin
Adin 2014 年 4 月 20 日
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:
But when I add labels it does this:
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?

採用された回答

lvn
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).

その他の回答 (1 件)

Marc Jakobi
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.)
  1 件のコメント
Dr. Erol Kalkan, P.E.
Dr. Erol Kalkan, P.E. 2018 年 10 月 12 日
This file is not available in fileexchange.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by