image thumbnail

tightfig(hfig)

version 1.7.0.0 (7.49 KB) by Richard Crozier
Remove excess margins from figures.

25.7K Downloads

Updated 13 Feb 2018

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Alters a figure so that it has the minimum size necessary to
enclose all axes in the figure without excess space around them.
Works for figures containing multiple axes as subplots.
Note that tightfig will expand the figure to completely encompass all
axes if necessary.
Returns an error if the figure contains any 3D axes which have been zoomed.

Cite As

Richard Crozier (2021). tightfig(hfig) (https://www.mathworks.com/matlabcentral/fileexchange/34055-tightfig-hfig), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!