<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Animation in Plot component</title>
    <link>http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 04:49:10 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 04:49:10 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Animation in Plot component</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Animation in Plot component</title>
      <link>http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component</link>
    </image>
    <item>
      <title>the pause</title>
      <link>http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component?ref=Feed:MaplePrimes:Animation in Plot component:Comments#answer128665</link>
      <itunes:summary>&lt;p&gt;First off, I think that one might need to set the Manipulator to "Click and Drag" so that that Action code is executed upon subsequent left-clicks, after the first animation. (I mention it, just in case anyone is having trouble running your example.)&lt;/p&gt;
&lt;p&gt;If I am understanding you, then the issue is that the "current" frame of the old animation is displayed while the upcoming animation is being computed by the kernel and prepared for insertion by the GUI. I saw this more clearly if I used your example with frames=400. Then I ran it I stopped part way through, then slid the playbar back to the beginning or one side, then left-clicked to get the Action. What I saw was that the "last" frame of the previous animation was displayed while the upcoming animation was being prepared.&lt;/p&gt;
&lt;p&gt;If I've understood rightly, then I should ask: what do you want displayed during that pause? The last shown frame of the previous animation, or a blank plot, or perhaps&amp;nbsp; the first frame of the upcoming animation? I think that any of these can be accomplished by adding in another line, before the insertion of the upcoming animation. Eg, uncommenting the one you want,&lt;/p&gt;
&lt;pre&gt;use DocumentTools, plots in

if cc = red then cc:= blue else cc:= red fi;

# quickly insert first frame of coming animation
#SetProperty(Plot0,value,plot(eval(sin(x+t),x=0),t=0..Pi,colour=cc),refresh=true);

# quickly insert blank frame
#SetProperty(Plot0,value,plot([[0,undefined]]),refresh=true);

# quickly insert something else
#...

SetProperty(Plot0,value,
            animate(plot,[sin(x+t),t=0..Pi,colour=cc],x=0..Pi,frames=400),
            refresh=true);
SetProperty(Plot0,play,true,refresh=true)

end use;
&lt;/pre&gt;
&lt;!--break--&gt;
&lt;p&gt;This is one of several reasons why I don't like using the traditional animation data structure inside Plot components. Another problem (for me) was that the animation runs asynchronously so any commands that come in the same code, but after the play command, get performed but then overridden by the animation which might still be playing asynchronously in its own thread. I was unable to find a reliable way to promptly apply an action that would occur only when the animation finished. The other main problem with traditional animations is, of course, their &lt;strong&gt;heavy&lt;/strong&gt; use of memory resources in computing all frames up front. I believe that Maple is now fast enough that most "animations" can be done in an frame-by-frame computed-on-the-fly way, where all the controls would be done via library level &amp;amp; Component code. (Joe's comment about reusing a mere reference to an rtable inside a PLOT data structure may be extremely important here, for performance.)&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;First off, I think that one might need to set the Manipulator to "Click and Drag" so that that Action code is executed upon subsequent left-clicks, after the first animation. (I mention it, just in case anyone is having trouble running your example.)&lt;/p&gt;
&lt;p&gt;If I am understanding you, then the issue is that the "current" frame of the old animation is displayed while the upcoming animation is being computed by the kernel and prepared for insertion by the GUI. I saw this more clearly if I used your example with frames=400. Then I ran it I stopped part way through, then slid the playbar back to the beginning or one side, then left-clicked to get the Action. What I saw was that the "last" frame of the previous animation was displayed while the upcoming animation was being prepared.&lt;/p&gt;
&lt;p&gt;If I've understood rightly, then I should ask: what do you want displayed during that pause? The last shown frame of the previous animation, or a blank plot, or perhaps&amp;nbsp; the first frame of the upcoming animation? I think that any of these can be accomplished by adding in another line, before the insertion of the upcoming animation. Eg, uncommenting the one you want,&lt;/p&gt;
&lt;pre&gt;use DocumentTools, plots in

if cc = red then cc:= blue else cc:= red fi;

# quickly insert first frame of coming animation
#SetProperty(Plot0,value,plot(eval(sin(x+t),x=0),t=0..Pi,colour=cc),refresh=true);

# quickly insert blank frame
#SetProperty(Plot0,value,plot([[0,undefined]]),refresh=true);

# quickly insert something else
#...

SetProperty(Plot0,value,
            animate(plot,[sin(x+t),t=0..Pi,colour=cc],x=0..Pi,frames=400),
            refresh=true);
SetProperty(Plot0,play,true,refresh=true)

end use;
&lt;/pre&gt;
&lt;!--break--&gt;
&lt;p&gt;This is one of several reasons why I don't like using the traditional animation data structure inside Plot components. Another problem (for me) was that the animation runs asynchronously so any commands that come in the same code, but after the play command, get performed but then overridden by the animation which might still be playing asynchronously in its own thread. I was unable to find a reliable way to promptly apply an action that would occur only when the animation finished. The other main problem with traditional animations is, of course, their &lt;strong&gt;heavy&lt;/strong&gt; use of memory resources in computing all frames up front. I believe that Maple is now fast enough that most "animations" can be done in an frame-by-frame computed-on-the-fly way, where all the controls would be done via library level &amp;amp; Component code. (Joe's comment about reusing a mere reference to an rtable inside a PLOT data structure may be extremely important here, for performance.)&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>128665</guid>
      <pubDate>Mon, 12 Dec 2011 10:52:11 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
    <item>
      <title>last frame</title>
      <link>http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component?ref=Feed:MaplePrimes:Animation in Plot component:Comments#comment128668</link>
      <itunes:summary>&lt;p&gt;Thanks, the "quickly insert first frame" seems to work for me.&amp;nbsp; It wouldn't have been so bad if the last frame of the old animation was displayed: the problem was that it was going back to the&lt;strong&gt; first&lt;/strong&gt; frame of the old animation.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks, the "quickly insert first frame" seems to work for me.&amp;nbsp; It wouldn't have been so bad if the last frame of the old animation was displayed: the problem was that it was going back to the&lt;strong&gt; first&lt;/strong&gt; frame of the old animation.&lt;/p&gt;</description>
      <guid>128668</guid>
      <pubDate>Mon, 12 Dec 2011 11:17:37 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>or a single-frame or very brief animation</title>
      <link>http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component?ref=Feed:MaplePrimes:Animation in Plot component:Comments#comment128669</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component#comment128668"&gt;@Robert Israel&lt;/a&gt; I noticed that a single plot, as the kludge insertion, doesn't include the text portion which shows the current value of the animation paraneter. Ie, a textplot with "z=...." in the plot region.&lt;/p&gt;
&lt;p&gt;If you can discern that absence, for the kludged insertion, then you might be able to instead make the kludge be a 1- (or unchanging 2-frame) animation that also computes and inserts quickly.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/128658-Animation-In-Plot-Component#comment128668"&gt;@Robert Israel&lt;/a&gt; I noticed that a single plot, as the kludge insertion, doesn't include the text portion which shows the current value of the animation paraneter. Ie, a textplot with "z=...." in the plot region.&lt;/p&gt;
&lt;p&gt;If you can discern that absence, for the kludged insertion, then you might be able to instead make the kludge be a 1- (or unchanging 2-frame) animation that also computes and inserts quickly.&lt;/p&gt;</description>
      <guid>128669</guid>
      <pubDate>Mon, 12 Dec 2011 11:35:25 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>