<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887</link>
    <title>MATLAB Central Newsreader - figure size in pixels?</title>
    <description>Feed for thread: figure size in pixels?</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>Sat, 19 Apr 2008 14:32:02 -0400</pubDate>
      <title>figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427684</link>
      <author>David Doria</author>
      <description>I want to save a figure to a file with a particular size in&lt;br&gt;
pixels.  I do this:&lt;br&gt;
&lt;br&gt;
figure('units','pixels','outerposition',[0 0 800 450]);&lt;br&gt;
set(gcf,'PaperPositionMode','auto');&lt;br&gt;
print('-djpeg', filename);&lt;br&gt;
&lt;br&gt;
but the resulting file is 1237x575!!&lt;br&gt;
&lt;br&gt;
What have I done wrong?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Sat, 19 Apr 2008 14:49:02 -0400</pubDate>
      <title>Re: figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427688</link>
      <author>French Caro</author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fucvp1$4rl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I want to save a figure to a file with a particular size in&lt;br&gt;
&amp;gt; pixels.  I do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; figure('units','pixels','outerposition',[0 0 800 450]);&lt;br&gt;
&amp;gt; set(gcf,'PaperPositionMode','auto');&lt;br&gt;
&amp;gt; print('-djpeg', filename);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but the resulting file is 1237x575!!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What have I done wrong?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Dave&lt;br&gt;
HI&lt;br&gt;
I think you should use Position property no Outerposition &lt;br&gt;
(which is an axes property at least, I can't find it in&lt;br&gt;
figure properties)</description>
    </item>
    <item>
      <pubDate>Sat, 19 Apr 2008 15:30:05 -0400</pubDate>
      <title>Re: figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427690</link>
      <author>David Doria</author>
      <description>figure('units','pixels','Position',[100 100 800 450]);&lt;br&gt;
%[left bottom width height]&lt;br&gt;
&lt;br&gt;
%subplot position is relative to the figure and hence&lt;br&gt;
doesn't change anything about the previous command, correct?&lt;br&gt;
LeftPlot = subplot('Position', [0 .1 .5 .8]); %[left bottom&lt;br&gt;
width height]&lt;br&gt;
&lt;br&gt;
set(gcf,'PaperPositionMode','auto');&lt;br&gt;
print('-djpeg', filename);&lt;br&gt;
&lt;br&gt;
the files produced are now 1249x704!! what the heck??&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Sat, 19 Apr 2008 16:38:02 -0400</pubDate>
      <title>Re: figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427702</link>
      <author>David Doria</author>
      <description>Turns out there is an m file on the file exchange called&lt;br&gt;
&lt;br&gt;
saveSameSize.m that does exactly what I needed.&lt;br&gt;
&lt;br&gt;
If anyone still has a simple explanation of why it didn't&lt;br&gt;
work the way I did it I'll still take it haha!</description>
    </item>
    <item>
      <pubDate>Sat, 19 Apr 2008 17:24:02 -0400</pubDate>
      <title>Re: figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427707</link>
      <author>Joaquim Luis</author>
      <description>&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fud75a$onq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Turns out there is an m file on the file exchange called&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; saveSameSize.m that does exactly what I needed.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If anyone still has a simple explanation of why it didn't&lt;br&gt;
&amp;gt; work the way I did it I'll still take it haha!&lt;br&gt;
&lt;br&gt;
Maybe you want to read the comments inside my imcapture.m &lt;br&gt;
which likely would have done the job as well.&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/&lt;/a&gt;&lt;br&gt;
loadFile.do?objectId=13355&amp;objectType=FILE&lt;br&gt;
&lt;br&gt;
J. Luis</description>
    </item>
    <item>
      <pubDate>Sun, 20 Apr 2008 17:22:01 -0400</pubDate>
      <title>Re: figure size in pixels?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/167887#427815</link>
      <author>Dan Haeg</author>
      <description>&quot;Joaquim Luis&quot; &amp;lt;jluis@--ualg--.pt&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fud9ri$d1h$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;fud75a$onq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Turns out there is an m file on the file exchange called&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; saveSameSize.m that does exactly what I needed.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If anyone still has a simple explanation of why it didn't&lt;br&gt;
&amp;gt; &amp;gt; work the way I did it I'll still take it haha!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Maybe you want to read the comments inside my imcapture.m &lt;br&gt;
&amp;gt; which likely would have done the job as well.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/&lt;/a&gt;&lt;br&gt;
&amp;gt; loadFile.do?objectId=13355&amp;objectType=FILE&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; J. Luis&lt;br&gt;
&lt;br&gt;
Joaquim,&lt;br&gt;
I think your program will help me also. Unfortunately I get&lt;br&gt;
the following error when trying to run your example:&lt;br&gt;
&lt;br&gt;
??? Error using ==&amp;gt; imcapture at 191&lt;br&gt;
Error using ==&amp;gt; hardcopy&lt;br&gt;
Unknown device 'none' for hardcopy.&lt;br&gt;
&lt;br&gt;
Do you have any idea how to fix it? I am using r2007A on&lt;br&gt;
windows.&lt;br&gt;
&lt;br&gt;
Dan</description>
    </item>
  </channel>
</rss>

