File Exchange

image thumbnail


version (2.86 KB) by Richard Quist
Quickly set figure properties so printed/exported figure will fill entire page.


Updated 01 Sep 2016

View Version History

View License

fillPage allows you to easily adjust properties that affect the size and position of a figure to be printed/exported, so that the generated output will "fill" the page within specified (or default) margins.
fillPage returns the original property values in a structure, allowing them to be restored/reset after printing.

fillPage also allows you to optionally specify a margin to use, as well as the size/type of paper (A4, usletter, 12x15) to output to.

Cite As

Richard Quist (2021). fillPage (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)


James Liu



very Good

ahmed kaffel

didn't work


works great on windows, but seems to have no effect on linux?


Perfect code for creating PDFs from Matlab plots.


This function (unfortunately) doesn't produce good output for subplots with outside legends.

Richard Tantaris

Awesome! I've been looking for this for years.

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