Get rid of the white margin in saveas output

Version (1.81 KB) by E Akbas
MATLAB's saveas pads your figure with a white margin. This m-file is prevents that.
Updated 27 Jun 2014

View License

This m-file is an alternative to built-in saveas command. It saves your figure without the white box/margin around it.

Cite As

E Akbas (2024). Get rid of the white margin in saveas output (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Printing and Saving in Help Center and MATLAB Answers

Inspired: tightfig(hfig)

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Bugfix: an error was being produced when figure handle was given as input.

Outside legends were not handled correctly. Fixed.

Abbreviated author name in the license file.

Edited author's name in the m-file.

Updated the code to handle multiple axes within a figure, like subplots, colorbars.