<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237048</link>
    <title>MATLAB Central Newsreader - different size subwindows?</title>
    <description>Feed for thread: different size subwindows?</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>Sun, 05 Oct 2008 22:18:02 -0400</pubDate>
      <title>different size subwindows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237048#603829</link>
      <author>David Doria</author>
      <description>Original = imread('../lena.bmp');&lt;br&gt;
nearest = imresize(Original, 2, 'nearest');&lt;br&gt;
figure&lt;br&gt;
spax1 = subplot(1,2,1); imshow(Original)&lt;br&gt;
spax2 = subplot(1,2,2); imshow(nearest)&lt;br&gt;
&lt;br&gt;
I would expect the image on the right to be twice as large as the image on the left, but they are displayed the same size. The variables contain twice as many pixels, so why isn't this reflected in the display?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Mon, 06 Oct 2008 10:02:02 -0400</pubDate>
      <title>Re: different size subwindows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237048#603871</link>
      <author>Jan Simon</author>
      <description>Dear David Doria!&lt;br&gt;
&lt;br&gt;
&amp;gt; Original = imread('../lena.bmp');&lt;br&gt;
&amp;gt; nearest = imresize(Original, 2, 'nearest');&lt;br&gt;
&amp;gt; figure&lt;br&gt;
&amp;gt; spax1 = subplot(1,2,1); imshow(Original)&lt;br&gt;
&amp;gt; spax2 = subplot(1,2,2); imshow(nearest)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The variables contain twice as many pixels, so why isn't this reflected in the display?&lt;br&gt;
&lt;br&gt;
The sizes of the created axes objects are determined by the SUBPLOT command. In consequence, the 2nd plot contains 4 times (not twice) more data points (not pixels) as the 1st one. Try it with a 1x1 picture!&lt;br&gt;
&lt;br&gt;
To create larger pictures, you can adjust the POSITION property of the spax1/2 objects.&lt;br&gt;
&lt;br&gt;
Jan</description>
    </item>
    <item>
      <pubDate>Mon, 06 Oct 2008 11:48:02 -0400</pubDate>
      <title>Re: different size subwindows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237048#603879</link>
      <author>David Doria</author>
      <description>sure sure, 4x as many pixels, i mean twice as many per dimension.&lt;br&gt;
&lt;br&gt;
So I've done something like this:&lt;br&gt;
&lt;br&gt;
spax1 = subplot(1,2,1); imshow(Original)&lt;br&gt;
spax2 = subplot(1,2,2);&lt;br&gt;
set(gca, 'position',[.1  .1  .8  .6]);&lt;br&gt;
imshow(nearest)&lt;br&gt;
&lt;br&gt;
Is there not a more automatic way to do this, where it sizes them based on their size, perhaps(haha)?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Mon, 06 Oct 2008 14:00:36 -0400</pubDate>
      <title>Re: different size subwindows?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237048#603901</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:gcctti$58$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; sure sure, 4x as many pixels, i mean twice as many per dimension.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; So I've done something like this:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; spax1 = subplot(1,2,1); imshow(Original)&lt;br&gt;
&amp;gt; spax2 = subplot(1,2,2);&lt;br&gt;
&amp;gt; set(gca, 'position',[.1  .1  .8  .6]);&lt;br&gt;
&amp;gt; imshow(nearest)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is there not a more automatic way to do this, where it sizes them based on &lt;br&gt;
&amp;gt; their size, perhaps(haha)?&lt;br&gt;
&lt;br&gt;
Set the Units property of spax1 and spax2 to pixels, then get their Position &lt;br&gt;
properties and update the last two components of the Position based on the &lt;br&gt;
sizes of the images.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Original = imread('eight.tif');&lt;br&gt;
nearest = imresize(Original, 2, 'nearest');&lt;br&gt;
figure&lt;br&gt;
spax1 = subplot(1,2,1); imshow(Original)&lt;br&gt;
spax2 = subplot(1,2,2); imshow(nearest)&lt;br&gt;
set([spax1, spax2], 'Units', 'pixels')&lt;br&gt;
P1 = get(spax1, 'Position');&lt;br&gt;
P2 = get(spax2, 'Position');&lt;br&gt;
% Assuming Original is a 2-D matrix, not a 3-D array&lt;br&gt;
set(spax1, 'Position', [P1(1:2) size(Original)./2]);&lt;br&gt;
set(spax2, 'Position', [P2(1:2) size(nearest)./2]);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
You may also want to adjust the first two components, to &quot;recenter&quot; the axes &lt;br&gt;
in their subplot area.  Note, however, that this won't update the size of &lt;br&gt;
the axes if you resize the figure.  You might want to reset the Units &lt;br&gt;
property to 'normalized' after the code above if that's necessary or useful &lt;br&gt;
for your application.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
  </channel>
</rss>

