adjustFigure

Small utility function which adjusts all subplots in a figure to have the same properties. Useful when creating figures for publication.
44 Downloads
Updated 4 Feb 2019

View License

When creating figures with subplots for publications, the appearance (line width, tick length etc.) should be identical and easily be changeable without searching and double-checking if all properties are defined properly.
This function takes all plot axes of the current figure and adjusts the properties consistently for all axes. It can easily be executed at the end of a figure-creating function or called from the command line after the figure is created.

Matlab determines the length of axis ticks proportional to the longest axis, which can result in different subplot having different tick lengths. This function allows to specify the tick length in cm and will make them consistent for all plots in the figure.
Other properties can easily be added.

Example:
adjustFigure('TickLength',0.05,'AxesLineWidth',0.5,'TickDir','out')
will adjust all plots in the current figure to have a tick length of 0.05 cm, an axis line width of 1 and tick direction pointing outwards.

Cite As

Christian Keine (2024). adjustFigure (https://www.mathworks.com/matlabcentral/fileexchange/70094-adjustfigure), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2018b
Compatible with R2014b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.3

added try-catch for TickLabelGapOffset, since it seems to be newer than 2014b

1.0.2

update picture

1.0.1

updated figure

1.0.0