Why does the "subplot" function reserve so much whitespace?

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.

 Risposta accettata

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:

Più risposte (1)

Jan
Jan il 28 Feb 2019
Modificato: MathWorks Support Team il 7 Set 2022

2 Commenti

Yes, it's probably one of the most complained about feature of matlab. One can only hope that one day, it'll be improved.
@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.

Accedi per commentare.

Prodotti

Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by