Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Poor quality when saving figures as images
Date: Fri, 6 Nov 2009 02:16:03 +0000 (UTC)
Organization: John Deere
Lines: 11
Message-ID: <hd00t3$o98$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1257473763 24872 172.30.248.37 (6 Nov 2009 02:16:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 02:16:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2048672
Xref: news.mathworks.com comp.soft-sys.matlab:582904


I have a routine that processes some data and creates figures as it goes, and I want to know how to programatically save the figures as images, and get the exact same results as I would get via the File > Save As... menu dialog from the figure window.

Currently, if I save a figure through the File > Save As... menu, I'm happy with the way it looks (just like it looks on screen).  But if I try to programatically save the same figures using saveas or print like below, they look bad in my opinion.  I lose the background color I specified, the aspect ratio isn't what I specified, the font size is huge, etc.
     
saveas(gcf,path,'png');   
-OR-
print(gcf,'-dpng',path);

How can I avoid the ugly "default" look and get the same results as when manually saving via the menu?

Thanks!