Question: subplot axes label cut off (activepositionproperty problem?)

131 views (last 30 days)
Paul B
Paul B on 21 Feb 2012
Commented: Sebastian Henn on 4 Aug 2021
Hi! I want to make a subplot such that two plots are side by side. The resulting figure needs to be small enough to fit in my document, and in the eps format. However, when I try to resize the figure past a certain size, the axes x labels are cut off like so :
this only happens when you resize it small enough. Also, it doesn't happen with the 'plot' command, I can resize as much as i like and the axes labels are maintained in the figure. My understanding is that activepositionproperty governs this sort of thing, and that it should be set to 'outerposition', but I've tried forcing that and it doesn't have any effect. Also, it doesn't seem to matter if you manually set the papersize and paperposition and then export, or whether you change the figure size using WYSIWYG on screen and then exporting. Would be grateful for any ideas to work around or fix this problem! I'm sure it didn't used to happen on earlier versions of matlab
  3 Comments
Paul B
Paul B on 21 Feb 2012
By the way I've managed to test it with matlab r2007b, and i can confirm that there is no problem with the xlabel no matter how small you size the figure. So it seems to me this is a problem with how recent versions of matlab handle the activepositionproperty within the subplot environment, unless I'm doing something stupid!

Sign in to comment.

Accepted Answer

Jason P
Jason P on 28 Feb 2012
I have been having the same problem but just got around it by "hacking" the axis position for each of the subplots:
v = get(gca,'Position');
set(gca,'Position',[v(1) v(2)*1.5 v(3:4)])
and you can adjust the values v(2) and v(4) to be whatever looks best for you.
  1 Comment
Paul B
Paul B on 21 Apr 2012
Ok thanks Jason! This is a good workaround but I still think the original problem is a bug. Will get round to reporting it one day!

Sign in to comment.

More Answers (4)


Shep Bryan
Shep Bryan on 29 Jan 2021
I have found a pretty decent work around. When you make your xlabel, add an extra blank line like this:
xlabel({'my label', ''})
That way the extra line gets cut off, but the real label is preserved.


Community Treasure Hunt

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

Start Hunting!