adjustFigure

版本 1.0.3 (2.7 KB) 作者: Christian Keine
Small utility function which adjusts all subplots in a figure to have the same properties. Useful when creating figures for publication.
44.0 次下载
更新时间 2019/2/4

查看许可证

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.

引用格式

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

MATLAB 版本兼容性
创建方式 R2018b
与 R2014b 及更高版本兼容
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Subplots 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
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