I have a "subplot" function which plots 12 axes on one figure. When I maximize the figure the axes are spaced evenly, but too much whitespace is placed around each axis.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 1 月 18 日
編集済み: MathWorks Support Team 2024 年 2 月 29 日

0 投票

The "subplot" function provides a convenient way of specifying axes positions. As it is a high-level function, explicit control of each axes position is not given to the user. If you wish to change the position of axes for subplots, you need to explicitly set the 'Position' properties of those axes.
For example, the following command illustrates how to set the position of the axes (specified by the handle "h_axis") in its parent figure. 
set(h_axis, 'Position', [2 2 10 10]);
 
For further information on axes properties, please run the below command in the MATLAB R2018b command window to get the release specific documentation
web(fullfile(docroot, 'matlab/ref/matlab.graphics.axis.axes-properties.html'))
Please follow the below link to search for the required information regarding the current release:

その他の回答 (1 件)

Jan
Jan 2019 年 2 月 28 日
編集済み: MathWorks Support Team 2022 年 9 月 7 日

1 投票

2 件のコメント

Guillaume
Guillaume 2019 年 2 月 28 日
Yes, it's probably one of the most complained about feature of matlab. One can only hope that one day, it'll be improved.
Jan
Jan 2019 年 2 月 28 日
@Guillaume: Some other evergreens in the FileExchange:
  • Replacements for waitbar (some are powerful, e.g. for parfor)
  • Recursive dir (implemented in R2016b)
  • XML import and export
How frustrating! I cannot find a way to find the most frequently downloaded files in the FEX anymore. I'm confused by the new interface. What a pity that TMW spent time to modify the working interface of the FileExchange to a less usable version, instead of fixing the broken interface of the Answers forum.

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

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by