Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
saveas()/print() utilization

Subject: saveas()/print() utilization

From: RAB John

Date: 29 Aug, 2010 20:30:23

Message: 1 of 9

Hi all,

I'm trying to utilize MATLAB's saveas()/print() functions to save a figure in a .jpeg format. The problem is the figure being saved in a partialy open window mode (rather than maximized one). In this mode .jpeg file presents titles one on top of the other and a generaly bad quality/reslution.

I tried the following:

saveas(gcf,['test.jpg'], 'jpg');

and

set(gcf, 'PaperPositionMode', 'auto');
print(gcf, '-r0', 'test.png', '-dpng');

but couldn't do the trick.

Suggestions/Comments would be welcome.
Thx,
RAB

Subject: saveas()/print() utilization

From: Walter Roberson

Date: 29 Aug, 2010 20:33:16

Message: 2 of 9

On 29/08/10 3:30 PM, RAB John wrote:

> I'm trying to utilize MATLAB's saveas()/print() functions to save a
> figure in a .jpeg format.

Please check the Mathworks File Exchange (FEX) for a contribution named
export_fig

Subject: saveas()/print() utilization

From: RAB John

Date: 29 Aug, 2010 20:45:05

Message: 3 of 9

Walter Roberson <roberson@hushmail.com> wrote in message <huzeo.7866$sL7.1999@newsfe15.iad>...
> On 29/08/10 3:30 PM, RAB John wrote:
>
> > I'm trying to utilize MATLAB's saveas()/print() functions to save a
> > figure in a .jpeg format.
>
> Please check the Mathworks File Exchange (FEX) for a contribution named
> export_fig

THX Walter I'll do that.
No standard MATLAB function?

Subject: saveas()/print() utilization

From: Walter Roberson

Date: 29 Aug, 2010 21:21:24

Message: 4 of 9

On 29/08/10 3:45 PM, RAB John wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message
> <huzeo.7866$sL7.1999@newsfe15.iad>...
>> On 29/08/10 3:30 PM, RAB John wrote:
>>
>> > I'm trying to utilize MATLAB's saveas()/print() functions to save a
>> > figure in a .jpeg format.
>>
>> Please check the Mathworks File Exchange (FEX) for a contribution
>> named export_fig
>
> THX Walter I'll do that.
> No standard MATLAB function?

There are problems and limitations with print() and problems with
saveas(), and the image types supported are not the same for the two.
The contribution export_fig has been designed to get around those
problems and limitations.

Subject: saveas()/print() utilization

From: RAB John

Date: 29 Aug, 2010 22:58:04

Message: 5 of 9

Walter Roberson <roberson@hushmail.com> wrote in message <pbAeo.2091$rC7.1398@newsfe10.iad>...
> On 29/08/10 3:45 PM, RAB John wrote:
> > Walter Roberson <roberson@hushmail.com> wrote in message
> > <huzeo.7866$sL7.1999@newsfe15.iad>...
> >> On 29/08/10 3:30 PM, RAB John wrote:
> >>
> >> > I'm trying to utilize MATLAB's saveas()/print() functions to save a
> >> > figure in a .jpeg format.
> >>
> >> Please check the Mathworks File Exchange (FEX) for a contribution
> >> named export_fig
> >
> > THX Walter I'll do that.
> > No standard MATLAB function?
>
> There are problems and limitations with print() and problems with
> saveas(), and the image types supported are not the same for the two.
> The contribution export_fig has been designed to get around those
> problems and limitations.

THX again Walter!
I'll do as you suggested.

Subject: saveas()/print() utilization

From: ImageAnalyst

Date: 30 Aug, 2010 01:19:55

Message: 6 of 9

Since we see these "saving figures" questions every day, Walter's
answer should be added to the FAQ. Problems with getting the saved
figure to look right must be the single most asked question here.
(And, no, I'm not the author of export_fig but it sure does eliminate
headaches for me.)

Subject: saveas()/print() utilization

From: Steven_Lord

Date: 30 Aug, 2010 13:52:13

Message: 7 of 9



"ImageAnalyst" <imageanalyst@mailinator.com> wrote in message
news:ef550af9-e40e-4a2c-8f76-a044d71dcc96@l6g2000yqb.googlegroups.com...
> Since we see these "saving figures" questions every day, Walter's
> answer should be added to the FAQ. Problems with getting the saved
> figure to look right must be the single most asked question here.
> (And, no, I'm not the author of export_fig but it sure does eliminate
> headaches for me.)

If you (the royal you, not just ImageAnalyst) craft up the Q and the answer,
I can add it to section 5 of the FAQ.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: saveas()/print() utilization

From: ImageAnalyst

Date: 30 Aug, 2010 14:19:12

Message: 8 of 9

I'm not sure if it's "allowed" to refer to File Exchange submissions
in the FAQ. Is it?

Subject: saveas()/print() utilization

From: Steven_Lord

Date: 30 Aug, 2010 15:50:17

Message: 9 of 9



"ImageAnalyst" <imageanalyst@mailinator.com> wrote in message
news:7e8dfd61-6693-4342-8b98-bfb892e4c247@i31g2000yqm.googlegroups.com...
> I'm not sure if it's "allowed" to refer to File Exchange submissions
> in the FAQ. Is it?

See question 5.5 in the FAQ :)

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

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.

Contact us