Path: news.mathworks.com!not-for-mail
From: Gautam Vallabha <Gautam.Vallabha@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Problem constraining dimensions in figure saved as eps
Date: Thu, 23 Aug 2007 09:27:54 -0400
Organization: The MathWorks
Lines: 36
Message-ID: <MPG.213755656292cf59989686@news.mathworks.com>
References: <fai832$4jm$1@fred.mathworks.com>
NNTP-Posting-Host: vallabhag.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1187875674 4497 144.212.219.54 (23 Aug 2007 13:27:54 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 23 Aug 2007 13:27:54 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:425198



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