<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156912</link>
    <title>MATLAB Central Newsreader - Plot to a figure from a function</title>
    <description>Feed for thread: Plot to a figure from a function</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, 29 Sep 2007 20:28:13 -0400</pubDate>
      <title>Plot to a figure from a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156912#394477</link>
      <author>David Doria</author>
      <description>in my script i do&lt;br&gt;
&lt;br&gt;
h = figure;&lt;br&gt;
&lt;br&gt;
then i have a loop which calls a function 'MyFunction' with&lt;br&gt;
&lt;br&gt;
MyFunction(h(1), more_params)&lt;br&gt;
&lt;br&gt;
the function definition for MyFunction is&lt;br&gt;
&lt;br&gt;
function MyFunction(h, more_params)&lt;br&gt;
&lt;br&gt;
inside MyFunction, i do&lt;br&gt;
&lt;br&gt;
plot(h, ones(10))&lt;br&gt;
&lt;br&gt;
and nothing(!) happens until after the program finishes&lt;br&gt;
running, at which point i get a blank axis displayed&lt;br&gt;
&lt;br&gt;
does it not work like this?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
David</description>
    </item>
    <item>
      <pubDate>Sat, 29 Sep 2007 21:03:42 -0400</pubDate>
      <title>Re: Plot to a figure from a function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156912#394480</link>
      <author>Rick Rosson</author>
      <description>Hi David,&lt;br&gt;
&lt;br&gt;
The plot function expects an axes handle, not a figure handle.  Try the &lt;br&gt;
following:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;f = figure;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;a = axes;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;MyFunction(a, ...);&lt;br&gt;
&lt;br&gt;
Inside the function:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(a, ... );&lt;br&gt;
&lt;br&gt;
I hope that helps.&lt;br&gt;
&lt;br&gt;
Thanks.&lt;br&gt;
&lt;br&gt;
Rick&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;David Doria&quot; &amp;lt;daviddoria@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:fdmcgt$1cj$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; in my script i do&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; h = figure;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; then i have a loop which calls a function 'MyFunction' with&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; MyFunction(h(1), more_params)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; the function definition for MyFunction is&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; function MyFunction(h, more_params)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; inside MyFunction, i do&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; plot(h, ones(10))&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and nothing(!) happens until after the program finishes&lt;br&gt;
&amp;gt; running, at which point i get a blank axis displayed&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; does it not work like this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; David </description>
    </item>
  </channel>
</rss>

