MATLAB Answers

How to change figure size within the figure window

146 views (last 30 days)
Nick Hitt
Nick Hitt on 13 Aug 2017
Answered: Chad Greene on 13 Aug 2017
Hello! I've been trying to make a subplot with 3 panels using subtightplot and my axis labels (both x and y) are being cut off. I can get the xis labels to appear If I constantly drag the corners of the figure window (to resize it) but that makes my figure huge. Is there any way to set the interior figure size and window size so I can see my axis labels? I've tried using 'InnerPosition' and 'OuterPosition', but that seems to only change the size of the entire figure
Thanks!

  0 Comments

Sign in to comment.

Accepted Answer

Chad Greene
Chad Greene on 13 Aug 2017
I think you want to change the position of the axes, not the figure. So try
ax1pos = get(gca,'position')
which will give you a four-element array containing
  1. the lower left corner x position,
  2. the lower left corner y position,
  3. the axis width,
  4. the axis height.
Adjust the second and fourth values to get some room for labels. Then set the new axis position with
set(gca,'position',ax1pos_adjusted)

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.