Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: saveas with exact figure dimensions?
Date: Sun, 12 Oct 2008 21:03:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 23
Message-ID: <gctom6$b19$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223845382 11305 172.30.248.37 (12 Oct 2008 21:03:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 12 Oct 2008 21:03:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:494789


When I use
saveas(gcf, filename.pdf)

it produces a pdf with the figure centered on a 8.5x11 paper.

I have seen these
set(gcf, 'papersize', [width height]);
set(gcf, 'paperposition', [left bottom width height]);

but do you really have to set these manually? It seems like the default should be to save only the image - is there an option I'm not seeing to save only the image with no giant white border?

also, what is the difference between 

print('-dpdf', filename);

and 

saveas(gcf, filename.pdf)

?

Thanks,
Dave