Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Save figure within GUI not working
Date: Thu, 17 Jul 2008 00:29:02 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 35
Message-ID: <g5m3oe$3rm$1@fred.mathworks.com>
References: <g55ha6$itc$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216254542 3958 172.30.248.37 (17 Jul 2008 00:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Jul 2008 00:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034498
Xref: news.mathworks.com comp.soft-sys.matlab:479878



"Amir " <amirschricker.DELETE@DELETE.gmail.DELETE.com> wrote
in message <g55ha6$itc$1@fred.mathworks.com>...
> Hi. I have a GUI that contains a plot, which I'm trying to 
> be able to save as a PDF at the click of a button. It isn't 
> working perfectly, however. A PDF is created with the 
> correct plot and all, but the position/size of the plot in 
> the PDF isn't fullscreen (as if I created it from the 
> Matlab command window), rather the same shape/size as it is 
> on the GUI. 
> 
> Here is the code I use:
> 
> function saveasPDF_Callback(hObject, eventdata, handles)
>  [f p]=uiputfile('*.pdf','Save as PDF');
>  newFig=figure;
>  axesObject2=copyobj(handles.axes1,newFig);
>  print(newFig,'-dpdf',[p f]);
> 
> 
> Any ideas? Thanks!

Check the PaperPositionMode property of your figure. If it's
set to 'auto' then the output should sized to match the
figure's (newFig) width and height (based on the 3rd and 4th
values of the figure's Position property). If the
PaperPositionMode property is set to 'manual' then the
output should be sized based on the value of the figure's
PaperPosition property. 

-- 

Richard Quist
Software Developer
The MathWorks, Inc.