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.

 Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 18 Jan. 2024
Bearbeitet: MathWorks Support Team am 29 Feb. 2024
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:

Weitere Antworten (1)

Jan
Jan am 28 Feb. 2019
Bearbeitet: MathWorks Support Team am 7 Sep. 2022

1 Stimme

2 Kommentare

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 am 28 Feb. 2019
@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.

Melden Sie sich an, um zu kommentieren.

Produkte

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by