Thread Subject: Problem constraining dimensions in figure saved as eps

Subject: Problem constraining dimensions in figure saved as eps

From: First Last

Date: 22 Aug, 2007 20:59:14

Message: 1 of 4

Yet another saving, plotting question ...

If I have a plot that I've meticulously set the bounds for using

the gca and gcf property 'Position',

I can save the .fig file within a script/function using:

saveas(gcf,outputFigureName,'fig');

and it looks like it is supposed to. However, when I
similarly try to save an encapsulated postscript file using
either:

saveas(gcf,outputFigureName,'eps');

or

print(gcf,'-depsc',outputFigureName);

the page dimensions are messed up and the figures are not
where I set them as seen in the fig file.

However, if I go to the saveas command manually in the menu
of the open .fig file, that saves the dimensions very nicely.

I have seen the same problem with .png files as well.

How can I get the functional form of saveas (or print) to
behave with saving eps files?

Thanks ...

Subject: Problem constraining dimensions in figure saved as eps

From: First Last

Date: 22 Aug, 2007 22:29:42

Message: 2 of 4

Strangely, the issue is 'resolved' when I simply use

axis square

to constrain the dimensions of the figure and subsequently
use one of the aforementioned 'print' or 'saveas' commands.
However there should still be a resolution to the previous
scenario.

Thanks,

Subject: Problem constraining dimensions in figure saved as eps

From: Sebastian Hölz

Date: 22 Aug, 2007 23:14:59

Message: 3 of 4

I would try to change the "papaperposition"-property of the
figure, so that it resembles the "position"-property. Take a
look at the help to see the difference.

Sebastian

Subject: Problem constraining dimensions in figure saved as eps

From: Gautam Vallabha

Date: 23 Aug, 2007 13:27:54

Message: 4 of 4

In article <fai832$4jm$1@fred.mathworks.com>, nospam@nospamplease.com
> I can save the .fig file within a script/function using:
> saveas(gcf,outputFigureName,'fig');
> and it looks like it is supposed to. However, when I
> similarly try to save an encapsulated postscript file using
> either:
> saveas(gcf,outputFigureName,'eps');
> or
> print(gcf,'-depsc',outputFigureName);
>
> the page dimensions are messed up and the figures are not
> where I set them as seen in the fig file.

When using "print -deps" and other options, you can adjust how the
figure should look on paper (e.g., if you want it to be tall and thin,
or short and wide).

1) Open the figure, then choose File -> Print Preview ..., and position
the size and location of the figure. (you can get the same dialog box by
typing 'printpreview').

2) After adjusting the position and size, note down the values
   >> get(gcf,'paperposition')
   ans =
    1.0000 4.7500 4.0000 3.7500

3) Specify those values when creating the figure
   >> figure('paperposition', [1.0 4.75 4.0 3.75]);

Then, when you say print -deps, the figure will come out sized
appropriately.

--
Gautam Vallabha
The MathWorks
Gautam.Vallabha@mathworks.com

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
saveas First Last 22 Aug, 2007 17:00:06
plots First Last 22 Aug, 2007 17:00:06
saving plots First Last 22 Aug, 2007 17:00:06
eps First Last 22 Aug, 2007 17:00:06
print First Last 22 Aug, 2007 17:00:06
figures First Last 22 Aug, 2007 17:00:06
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