Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Poor quality when saving figures as images
Date: Fri, 6 Nov 2009 03:39:02 +0000 (UTC)
Organization: Toshiba Research Europe Ltd
Lines: 20
Message-ID: <hd05om$j3k$1@fred.mathworks.com>
References: <hd00t3$o98$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257478742 19572 172.30.248.38 (6 Nov 2009 03:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 03:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1073021
Xref: news.mathworks.com comp.soft-sys.matlab:582914


"Brad " <wooleverbradj@johndeere.com> wrote in message <hd00t3$o98$1@fred.mathworks.com>...
> 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!

Hi

I don't know about the same as the Save as.. option, but export_fig generates an image of a figure as it appears on screen. You find it at:
http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig

HTH,
Oliver