Info

This question is closed. Reopen it to edit or answer.

How can I make make axis size change accordingly as i change the size of the figure?

1 view (last 30 days)
Hi I am kind of new to matlab graphics... I have created a figure and manually adjusted some of the properties of the figure and axis (e.g. XLim, YLim, YLimMode,Units,...etc). Then as I change the size of the figure window (e.g. maximize the figure window), the size of the axis simply does not change. I am just wondering what are the properties that controls the size of the axis so that it can change as I change the size of the figure window. Thanks a lot.

Answers (1)

dpb
dpb on 9 May 2014
The default position of the axes object within the figure is in percentages of the figure size; if you change the figure size by default those percentages are the retained so the axes change proportionally to the figure window size.
You must have changed the 'units' property to an absolute reference (such as 'inches') in one of your manual operations not given above. If you want to vary the figure size and have the axes change automagically with it, then don't switch from the relative units of 'normalized'.
An easy way to discover properties in handle graphics is to use set with the handle as the only argument -- all the properties and their current values will be shown to the command window.

Community Treasure Hunt

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

Start Hunting!