version (1.99 KB) by Rob Comer
Reset axes position and limits to fill figure.


Updated Thu, 01 Sep 2016 15:03:38 +0000

View License

FILLFIGURE resets the position of an axes, and either its XLim or its YLlim, so that the axes completely fills its parent figure. After calling FILLFIGURE, you can make use of the entire figure window while zooming and panning an image.
The image used in the screen shot and first example, ngc6543a.jpg, is part of the standard MATLAB distribution. This image was created by the Space Telescope Science Institute, operated by the Association of Universities for Research in Astronomy, Inc., with support from NASA contract NAS5-26555, and is reproduced with permission from AURA/STScI. Digital renditions of images produced by AURA/STScI are obtainable royalty-free. Credits: J. P. Harrington and K. J. Borkowski (University of Maryland), and NASA.

Cite As

Rob Comer (2022). fillfigure (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
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!