Thread Subject: Poor quality when saving figures as images

Subject: Poor quality when saving figures as images

From: Brad

Date: 6 Nov, 2009 02:16:03

Message: 1 of 4

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!

Subject: Poor quality when saving figures as images

From: Oliver Woodford

Date: 6 Nov, 2009 03:39:02

Message: 2 of 4

"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

Subject: Poor quality when saving figures as images

From: roger

Date: 6 Nov, 2009 11:10:55

Message: 3 of 4

On Nov 6, 3:16 am, "Brad " <wooleverbr...@johndeere.com> wrote:
> 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!

try playing with the papertype, papersize, paperposition etc.
properties of the figure, these will allow you to control the size of
the printed image. There is a print option that lets you choose
whether to include the background colors or not, i forgot what it is
called but it should be in the print documentation.

Subject: Poor quality when saving figures as images

From: Brad

Date: 6 Nov, 2009 18:13:02

Message: 4 of 4

"Oliver Woodford" <o.j.woodford.98@cantab.net> wrote in message <hd05om$j3k$1@fred.mathworks.com>...
> "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

Thanks! This is doing pretty much exactly what I wanted.

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