<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172361</link>
    <title>MATLAB Central Newsreader - Save figure within GUI not working</title>
    <description>Feed for thread: Save figure within GUI not working</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 10 Jul 2008 17:36:06 -0400</pubDate>
      <title>Save figure within GUI not working</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172361#442315</link>
      <author>Amir </author>
      <description>Hi. I have a GUI that contains a plot, which I'm trying to &lt;br&gt;
be able to save as a PDF at the click of a button. It isn't &lt;br&gt;
working perfectly, however. A PDF is created with the &lt;br&gt;
correct plot and all, but the position/size of the plot in &lt;br&gt;
the PDF isn't fullscreen (as if I created it from the &lt;br&gt;
Matlab command window), rather the same shape/size as it is &lt;br&gt;
on the GUI. &lt;br&gt;
&lt;br&gt;
Here is the code I use:&lt;br&gt;
&lt;br&gt;
function saveasPDF_Callback(hObject, eventdata, handles)&lt;br&gt;
&amp;nbsp;[f p]=uiputfile('*.pdf','Save as PDF');&lt;br&gt;
&amp;nbsp;newFig=figure;&lt;br&gt;
&amp;nbsp;axesObject2=copyobj(handles.axes1,newFig);&lt;br&gt;
&amp;nbsp;print(newFig,'-dpdf',[p f]);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Any ideas? Thanks!</description>
    </item>
    <item>
      <pubDate>Thu, 17 Jul 2008 00:29:02 -0400</pubDate>
      <title>Re: Save figure within GUI not working</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172361#443524</link>
      <author>Richard Quist</author>
      <description>&quot;Amir &quot; &amp;lt;amirschricker.DELETE@DELETE.gmail.DELETE.com&amp;gt; wrote&lt;br&gt;
in message &amp;lt;g55ha6$itc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi. I have a GUI that contains a plot, which I'm trying to &lt;br&gt;
&amp;gt; be able to save as a PDF at the click of a button. It isn't &lt;br&gt;
&amp;gt; working perfectly, however. A PDF is created with the &lt;br&gt;
&amp;gt; correct plot and all, but the position/size of the plot in &lt;br&gt;
&amp;gt; the PDF isn't fullscreen (as if I created it from the &lt;br&gt;
&amp;gt; Matlab command window), rather the same shape/size as it is &lt;br&gt;
&amp;gt; on the GUI. &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Here is the code I use:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; function saveasPDF_Callback(hObject, eventdata, handles)&lt;br&gt;
&amp;gt;  [f p]=uiputfile('*.pdf','Save as PDF');&lt;br&gt;
&amp;gt;  newFig=figure;&lt;br&gt;
&amp;gt;  axesObject2=copyobj(handles.axes1,newFig);&lt;br&gt;
&amp;gt;  print(newFig,'-dpdf',[p f]);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any ideas? Thanks!&lt;br&gt;
&lt;br&gt;
Check the PaperPositionMode property of your figure. If it's&lt;br&gt;
set to 'auto' then the output should sized to match the&lt;br&gt;
figure's (newFig) width and height (based on the 3rd and 4th&lt;br&gt;
values of the figure's Position property). If the&lt;br&gt;
PaperPositionMode property is set to 'manual' then the&lt;br&gt;
output should be sized based on the value of the figure's&lt;br&gt;
PaperPosition property. &lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&lt;br&gt;
Richard Quist&lt;br&gt;
Software Developer&lt;br&gt;
The MathWorks, Inc.</description>
    </item>
  </channel>
</rss>

