Thread Subject: saveas cropping figure

Subject: saveas cropping figure

From: Andrew

Date: 26 May, 2008 10:01:03

Message: 1 of 3

Hi all,

I'm having a problem with saveas cropping my figure. The
figure has two columns of axes with a single legend above
them and horizontally centered. The axis and legend
positions are set by my code.

The resulting saved "tif" has the legend cut off the top,
so the top of the image is the top of the two columns of
axes. Using File->export gives the desired result however.

I tried expanding the loose inset of one of the axes so
that it included the legend, but no joy.

Does anyone have any ideas,
Thanks,
Andrew

Subject: saveas cropping figure

From: Richard Quist

Date: 28 May, 2008 14:05:45

Message: 2 of 3

Andrew wrote:
> Hi all,
>
> I'm having a problem with saveas cropping my figure. The
> figure has two columns of axes with a single legend above
> them and horizontally centered. The axis and legend
> positions are set by my code.
>
> The resulting saved "tif" has the legend cut off the top,
> so the top of the image is the top of the two columns of
> axes. Using File->export gives the desired result however.
>
> I tried expanding the loose inset of one of the axes so
> that it included the legend, but no joy.
>
> Does anyone have any ideas,
> Thanks,
> Andrew

My guess is that the output is being resized, causing objects to be
repositioned. You might want to verify that you're using normalized units when
setting positions.

Depending on your needs, saving the figure at the same size as on screen may
be acceptable. This is accomplished by setting the figure's PaperPositionMode
property to 'auto'. My saveSameSize File Exchange submission wraps this change
and a few others into one function that makes the changes, does the export and
then restores the original property values at the end. It's available from
http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1097474&objectType=author


--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: saveas cropping figure

From: Andrew

Date: 29 May, 2008 02:43:02

Message: 3 of 3

Works a treat thank you

Richard Quist <rquist_nospam@mathworks.com> wrote in
message <g1jorp$m2p$1@fred.mathworks.com>...
> Andrew wrote:
> > Hi all,
> >
> > I'm having a problem with saveas cropping my figure.
The
> > figure has two columns of axes with a single legend
above
> > them and horizontally centered. The axis and legend
> > positions are set by my code.
> >
> > The resulting saved "tif" has the legend cut off the
top,
> > so the top of the image is the top of the two columns
of
> > axes. Using File->export gives the desired result
however.
> >
> > I tried expanding the loose inset of one of the axes so
> > that it included the legend, but no joy.
> >
> > Does anyone have any ideas,
> > Thanks,
> > Andrew
>
> My guess is that the output is being resized, causing
objects to be
> repositioned. You might want to verify that you're using
normalized units when
> setting positions.
>
> Depending on your needs, saving the figure at the same
size as on screen may
> be acceptable. This is accomplished by setting the
figure's PaperPositionMode
> property to 'auto'. My saveSameSize File Exchange
submission wraps this change
> and a few others into one function that makes the
changes, does the export and
> then restores the original property values at the end.
It's available from
>
http://www.mathworks.com/matlabcentral/fileexchange/loadAuth
or.do?objectId=1097474&objectType=author
>
>
> --
>
> Richard Quist
> Software Developer
> The MathWorks, Inc.

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

Public Submission Policy

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 Disclaimer prior to use.

Contact us at files@mathworks.com