<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170462</link>
    <title>MATLAB Central Newsreader - Wrap a plot?</title>
    <description>Feed for thread: Wrap a plot?</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>Wed, 04 Jun 2008 18:35:10 -0400</pubDate>
      <title>Wrap a plot?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170462#435861</link>
      <author>David Doria</author>
      <description>I have values of x between 0 and 360 (angles). I have values&lt;br&gt;
corresponding to those angles in y.&lt;br&gt;
&lt;br&gt;
for example&lt;br&gt;
x = [1 4.5 7 9.8];&lt;br&gt;
y = [1 2 3 4];&lt;br&gt;
&lt;br&gt;
I am interested in what happens at the 0/360 line, and now&lt;br&gt;
those things are on opposite sides of the plot.  I'd like to&lt;br&gt;
have the plot like this&lt;br&gt;
&lt;br&gt;
270....360/0...90&lt;br&gt;
&lt;br&gt;
rather than&lt;br&gt;
&lt;br&gt;
0....180....360&lt;br&gt;
&lt;br&gt;
Is there a way to specify this in the plot properties?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Dave</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 19:04:40 -0400</pubDate>
      <title>Re: Wrap a plot?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170462#435866</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g26n8u$mhd$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
David Doria &amp;lt;daviddoria@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I have values of x between 0 and 360 (angles). I have values&lt;br&gt;
&amp;gt;corresponding to those angles in y.&lt;br&gt;
&lt;br&gt;
&amp;gt;for example&lt;br&gt;
&amp;gt;x = [1 4.5 7 9.8];&lt;br&gt;
&amp;gt;y = [1 2 3 4];&lt;br&gt;
&lt;br&gt;
&amp;gt;I am interested in what happens at the 0/360 line, and now&lt;br&gt;
&amp;gt;those things are on opposite sides of the plot.  I'd like to&lt;br&gt;
&amp;gt;have the plot like this&lt;br&gt;
&lt;br&gt;
&amp;gt;270....360/0...90&lt;br&gt;
&lt;br&gt;
&amp;gt;rather than&lt;br&gt;
&lt;br&gt;
&amp;gt;0....180....360&lt;br&gt;
&lt;br&gt;
&amp;gt;Is there a way to specify this in the plot properties?&lt;br&gt;
&lt;br&gt;
No. But you can&lt;br&gt;
&lt;br&gt;
xph = x &amp;gt;= 270 &amp; x &amp;lt; 360;&lt;br&gt;
xpl = x &amp;gt;= 0 &amp; x &amp;lt;= 90;&lt;br&gt;
plot([x(xph),360+x(xpl)], y([xph xpl]) );&lt;br&gt;
&lt;br&gt;
and then set the XTick to [270:step:450]&lt;br&gt;
and set the XTickLabels to [270:step:360-step 0:step:90]&lt;br&gt;
for appropriate step size.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Q: Why did the chicken cross the Mobius strip?&lt;br&gt;
&lt;br&gt;
A: There were manifold reasons.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Jun 2008 19:09:02 -0400</pubDate>
      <title>Re: Wrap a plot?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/170462#435868</link>
      <author>us</author>
      <description>&quot;David Doria&quot;:&lt;br&gt;
&amp;lt;SNIP axis acrobatics...&lt;br&gt;
&lt;br&gt;
one of the solutions&lt;br&gt;
&lt;br&gt;
% the data&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x=0:45:360;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y=x+25*(rand(size(x))-.5);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xc=270;&lt;br&gt;
% the plot&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ix=find(x&amp;gt;=xc,1,'first'); % FP issues&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ix=[ix:numel(x),1:ix-1];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(x,y(ix),'o-r');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set(gca,...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'xtick',x,...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'xticklabel',x(ix));&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
  </channel>
</rss>

