<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/322355</link>
    <title>MATLAB Central Newsreader - Linkaxes query and axis scaling</title>
    <description>Feed for thread: Linkaxes query and axis scaling</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 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.ch/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 07 Aug 2012 13:46:56 +0000</pubDate>
      <title>Linkaxes query and axis scaling</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/322355#884743</link>
      <author>David Robert</author>
      <description>Hello - I have a series of 8 subplots. Each of the subplots are surface plots, over an area of 1000 x 1000 with varying intensity. I want to plot them all with the same axis, rather than their own relative ideal axis. So basically, if the highest intensity of any of them was 10^15, I'd want them all to extend to 10^15. &lt;br&gt;
&lt;br&gt;
I use code like this;&lt;br&gt;
&lt;br&gt;
figure(1)&lt;br&gt;
h1 = subplot(4,2,1)&lt;br&gt;
h1s = surf(P5)&lt;br&gt;
set(h1s, 'edgecolor','none')&lt;br&gt;
h2 = subplot(4,2,2)&lt;br&gt;
h2s = surf(P10)&lt;br&gt;
set(h2s, 'edgecolor','none')&lt;br&gt;
h3 = subplot(4,2,3)&lt;br&gt;
h3s = surf(P15)&lt;br&gt;
set(h3s, 'edgecolor','none')&lt;br&gt;
h4 = subplot(4,2,4)&lt;br&gt;
h4s = surf(P20)&lt;br&gt;
set(h4s, 'edgecolor','none')&lt;br&gt;
h5 = subplot(4,2,5)&lt;br&gt;
h5s = surf(P25)&lt;br&gt;
set(h5s, 'edgecolor','none')&lt;br&gt;
h6 = subplot(4,2,6)&lt;br&gt;
h6s = surf(P30)&lt;br&gt;
set(h6s, 'edgecolor','none')&lt;br&gt;
h7 = subplot(4,2,7)&lt;br&gt;
h7s = surf(P35)&lt;br&gt;
set(h7s, 'edgecolor','none')&lt;br&gt;
h8 = subplot(4,2,8)&lt;br&gt;
h8s = surf(P40)&lt;br&gt;
set(h8s, 'edgecolor','none')&lt;br&gt;
pause(3)&lt;br&gt;
linkaxes([h1 h2 h3 h4 h5 h6 h7 h8],'xy');&lt;br&gt;
&lt;br&gt;
However, when I use it, it displays them all as relative only to themselves and produces the error "Warning: linkaxes requires 2-D axes as input. Use linkprop for generic property linking. "&lt;br&gt;
&lt;br&gt;
Any ideas on what I may be doing wrong ?&lt;br&gt;
&lt;br&gt;
Also, it is possible to have a single colorbar for all the plots, or at least scale them all the same ?&lt;br&gt;
&lt;br&gt;
Thanks!</description>
    </item>
    <item>
      <pubDate>Tue, 07 Aug 2012 16:51:47 +0000</pubDate>
      <title>Re: Linkaxes query and axis scaling</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/322355#884773</link>
      <author>Steven_Lord</author>
      <description>&lt;br&gt;
&lt;br&gt;
"David Robert" &amp;lt;grimesd2@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:49d89fa2-7e74-4dc5-901f-143af49ae29c@googlegroups.com...&lt;br&gt;
&amp;gt; Hello - I have a series of 8 subplots. Each of the subplots are surface &lt;br&gt;
&amp;gt; plots, over an area of 1000 x 1000 with varying intensity. I want to plot &lt;br&gt;
&amp;gt; them all with the same axis, rather than their own relative ideal axis. So &lt;br&gt;
&amp;gt; basically, if the highest intensity of any of them was 10^15, I'd want &lt;br&gt;
&amp;gt; them all to extend to 10^15.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I use code like this;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; figure(1)&lt;br&gt;
&amp;gt; h1 = subplot(4,2,1)&lt;br&gt;
&amp;gt; h1s = surf(P5)&lt;br&gt;
&amp;gt; set(h1s, 'edgecolor','none')&lt;br&gt;
&lt;br&gt;
FYI, you can do those previous two commands in one line.&lt;br&gt;
&lt;br&gt;
h1s = surf(P5, 'EdgeColor', 'none');&lt;br&gt;
&lt;br&gt;
SURF lets you specify surface property name/value pairs after the data you &lt;br&gt;
want to use to display the surface.&lt;br&gt;
&lt;br&gt;
*snip*&lt;br&gt;
&lt;br&gt;
&amp;gt; linkaxes([h1 h2 h3 h4 h5 h6 h7 h8],'xy');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; However, when I use it, it displays them all as relative only to &lt;br&gt;
&amp;gt; themselves and produces the error "Warning: linkaxes requires 2-D axes as &lt;br&gt;
&amp;gt; input. Use linkprop for generic property linking. "&lt;br&gt;
&lt;br&gt;
You're creating surface objects in each of your axes, therefore they're &lt;br&gt;
displaying as 3-D axes. As the warning indicates, LINKAXES is intended for &lt;br&gt;
use with 2-D axes.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.mathworks.com/help/techdoc/ref/linkaxes.html"&gt;http://www.mathworks.com/help/techdoc/ref/linkaxes.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
"Synchronize limits of specified 2-D axes"&lt;br&gt;
&lt;br&gt;
As the warning recommends, use LINKPROP to link the 'XLim' and 'YLim' &lt;br&gt;
properties of your 3-D axes instead.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.mathworks.com/help/techdoc/ref/axes_props.html#XLim"&gt;http://www.mathworks.com/help/techdoc/ref/axes_props.html#XLim&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&amp;gt; Also, it is possible to have a single colorbar for all the plots, or at &lt;br&gt;
&amp;gt; least scale them all the same ?&lt;br&gt;
&lt;br&gt;
Since the colormap is a property of the figure, not of the axes, at least &lt;br&gt;
theoretically yes. It depends on how you want the colorbar to look (in terms &lt;br&gt;
of size and position.) I'd probably make it 'peer' of either h4 or h8 and &lt;br&gt;
set its location to the east and outside of the peer axes.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com&lt;br&gt;
To contact Technical Support use the Contact Us link on &lt;br&gt;
&lt;a href="http://www.mathworks.com"&gt;http://www.mathworks.com&lt;/a&gt; </description>
    </item>
  </channel>
</rss>
