Animated plot wth GTKagg

Hello,

I'm trying to generate an animated plot embedded in gtk. The problem I have is
that the plot only gets drawn when the animation loop is finished instead of
everytime the draw() function is called inside the loop. Is there any other
way to force the plot to be redrawn ?

Best regards,

Ben Vanhaeren

Hi,

Hello,

I'm trying to generate an animated plot embedded in gtk. The problem I have is
that the plot only gets drawn when the animation loop is finished instead of
everytime the draw() function is called inside the loop. Is there any other
way to force the plot to be redrawn ?

From your description I suspect that you have a loop in
a subroutine which does one plot after another. However,
doing it this way does not leave gtk any opportunity to
refresh the corresponding window.
In the example of a moving sine
  http://matplotlib.sourceforge.net/examples/anim.py
John remarks that one has to
"""
# turn interactive mode on for dynamic updates. If you aren't in
# interactive mode, you'll need to use a GUI event handler/timer.
"""

Maybe you can use something from the mov_sin_mpl_gtk.py example,
http://sourceforge.net/mailarchive/forum.php?thread_id=6175425&forum_id=33405

I for myself haven't use embedding in gtk, so maybe someone
else has a working example...

Best,

Arnd

···

On Wed, 5 Jan 2005, Ben Vanhaeren wrote: