Thread Subject: output a pdf

Subject: output a pdf

From: David Doria

Date: 25 Mar, 2008 17:52:03

Message: 1 of 4

When I produce a figure and then do "File -> SaveAs" and
choose pdf, the pdf that matlab makes is too big - some of
the right side of the plot is chopped off in the pdf file.
Is there a way to overcome this?

Thanks,

David

Subject: output a pdf

From: David Doria

Date: 25 Mar, 2008 18:05:04

Message: 2 of 4

I found "File - Export Setup" - it let me change the width
to 5 inches , which fixed the inital problem. However, I am
trying to put this figure into a latex document, and it
seems matlab has added white space to fill up an 8.5x11
piece of paper instead of just using the 5" that I
specified. Is there a way to prevent this?

Thanks,

David

Subject: output a pdf

From: Richard Quist

Date: 25 Mar, 2008 18:45:35

Message: 3 of 4

David Doria wrote:
> I found "File - Export Setup" - it let me change the width
> to 5 inches , which fixed the inital problem. However, I am
> trying to put this figure into a latex document, and it
> seems matlab has added white space to fill up an 8.5x11
> piece of paper instead of just using the 5" that I
> specified. Is there a way to prevent this?
>
> Thanks,
>
> David

Something along this line may do the trick - assuming you want to the
output to be 5x5, set both the papersize AND the paperposition
properties on the figure:

   set(gcf, 'papersize', [5 5]);
   set(gcf, 'paperposition', [0 0 5 5]);
   print -dpdf test5x5.pdf

There's also my fillPage File Exchange submission
(http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=16566&objectType=FILE)
that helps with this kind of operation:
   oldSettings = fillpage(gcf, 'margins', [0 0 0 0], 'papersize', [5 5]);
   print -dpdf test5x5.pdf
   set(gcf, oldSettings); % restore previous settings

--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: output a pdf

From: David Doria

Date: 25 Mar, 2008 20:38:01

Message: 4 of 4

beautiful! that'll do it!

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com