Hello,
I am having problems with the WxAgg backend on the Mac not updating
figures. Using this test code:
import time
from pylab import *
x = linspace(0,6*pi,255)
y = sin(x)
h,=plot([0],[0],'g-')
show()
for i in xrange(250,len(x),25):
h.set_data(x[:i],y[:i])
axis([0,6*pi,-2,2])
draw()
time.sleep(0.5)
print i
Nothing changes until the script finishes. I've tried both 0.91.2 and
0.98. I don't seem to have these problems under Linux. Is there a
standard fix that I am missing? (The animation simple_anim_wx.py
didn't work for me either).
Thanks,
Marshall
Hi Marshall,
this mode of animation is very brittle and usually only works with
tkagg, if at all. I have been trying to update all the animation
examples in examples/anim to reflect better usage patterns, but I
noticed that some of these were broken too. I just patched them -- I
am no wx expert so there may be better idioms, but I'm attaching the
four here
* simple_idle_wx.py - use the wx idle handler
* simple_timer_wx.py - use the wx timer
* animation_blit_wx.py - use selective artist drawing for faster animations
* dynamic_image_wxagg2.py - animation with mpl embedded in a custom wx app
Hope these help!
JDH
simple_idle_wx.py (645 Bytes)
simple_timer_wx.py (779 Bytes)
animation_blit_wx.py (1.87 KB)
dynamic_image_wxagg2.py (2.97 KB)
···
On Sat, Sep 13, 2008 at 12:03 AM, Marshall Tappen <mtappen@...2036...> wrote:
I am having problems with the WxAgg backend on the Mac not updating
figures. Using this test code:
for i in xrange(250,len(x),25):
h.set_data(x[:i],y[:i])
axis([0,6*pi,-2,2])
draw()
time.sleep(0.5)
print i
Nothing changes until the script finishes. I've tried both 0.91.2 and