View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Adjust PDF page

5.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 1.89 KB File ID: #35264 Version: 1.0

Adjust PDF page


Cris Luengo (view profile)


MATLAB writes figures to PDF files as a full page. This function corrects that.

| Watch this File

File Information

By default, when writing a figure window to a PDF file, the figure's content is centered on an A4 or letter-sized page. This is not true for any other file format (EPS, TIFF, PNG, etc, where the bounding box of the resulting graphic, very sensibly, matches that of the figure window). This simple function sets the figure's PaperSize and PaperPosition properties so that the PDF file's bounding box matches that of the figure window.

   <create a nice plot>
   print -dpdf figure1.pdf

This function was created using Release 2011b, but should work for earlier releases also.

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
08 Feb 2016 Matthew Arthington

This is exactly what I needed. Thanks!

Such a shame that Matlab doesn't handle this sensibly by default.

Contact us