expandaxes

More reliable implementation of the option "expand axes to fill figure"
479 téléchargements
Mise à jour 15 oct. 2022

More reliable implementation of the option "expand axes to fill figure" in the Export Setup... settings.
Works with multiple subplots and usually does not distort objects such as colorbars. This function attempts to automatically remove white space in figures by expanding the axes objects to fill the figure. The available option in the "export setup" figure menu sometimes distorts the axes and often does not work at all if there is more than one axes or a colorbar. The common fix is to manually change the position of each axes, which can be a tedious process. This function attempts to automate the process while keeping the syntax as simple as possible. It automatically removes the white space of most figures with multiple subplots, superimpozed axes objects and colorbars without distorting the axes. The zip file contains the function and a script with examples of use.
Syntax: expandaxes(h)
expandaxes(h, fHor, fVer) - For manual adjustment of the distance between subplots
Input arguments:
- h: Figure handle
- fHor: Factor for the distance between subplots in horizontal direction (Default: 1)
- fVer: Factor for the distance between subplots in vertical direction (Default: 1)

Hints:
a) General rule of thumb for the order of execution when calling expandaxes:
1) Set objects, FontSizes, etc.
2) Call expandaxes
3) Other manipulations of axes and colorbar positions
b) By setting h.SizeChangedFcn = 'expandaxes(gcf, fHor, fVer);'; this function can be called with exery resize of the figure h.

Citation pour cette source

Marc Jakobi (2024). expandaxes (https://github.com/mrcjkb/expandaxes), GitHub. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2016b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Remerciements

Inspiré par : export_fig

Community Treasure Hunt

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

Start Hunting!

Les versions qui utilisent la branche GitHub par défaut ne peuvent pas être téléchargées

Version Publié le Notes de version
1.1.9.0

Bugfix for subplots only with 1 row or column.

1.1.8.0

Fix bug causing expandaxes to fail if the number of horizontal and vertical subplots are not the same.

1.1.7.0

Fixed bug with superimposed axes objects (e. g. plotyy) not being recognized.

1.1.6.0

Re-added description, which got lost during transition to GitHub

1.1.5.0

added thumbnail

1.1.4.0

- Fixed bug in getColorbarProperties subfunction (as noted by Roland).
- Replaced eval with dynamic field access

1.1.3.0

Fixed issues with docked figures by undocking them and restoring the WindowStyle at the end.

1.1.2.0

Reduced width and height expansion by a little bit to ensure that the box does not get cut off if the YTickLabel or XTickLabel does not reach to the edge of the axes.

1.1.0.0

subfunction still had MIT license. Removed it so that it is in compliance with the BSD license of expandaxes

1.0.0.0

Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.
Pour consulter ou signaler des problèmes liés à ce module complémentaire GitHub, accédez au dépôt GitHub.