On Wed, May 6, 2009 at 1:05 PM, Elan Pavlov <epav...@gmail.com> wrote: > Hi, > I can't get wxpython to play well with matplotlib and draw_artist. > After mucking around quite a bit I think I narrowed it down to the > draw_artist function The problem seems to be that draw_artist when > working within wxpython (as opposed to a simple mpl window) doesn't > remove the old points it plotted. I adapted the example from the > cookbook (http://www.scipy.org/Cookbook/Matplotlib/Animations) to > illustrate this problem. I modified the example so it is updated on > mouse movements (followed by idle time) so that the problem is more > visual. > > Replacing the copy_from_bbox/restore/draw_artist (i.e. removing the > animated properties) with the simple draw causes this to work. The > copy_from_bbox/restore methods work as expected so it seems that the > problem is either the draw_artist (or possibly the blit, but that > seems unlikely). > > Is there something I am doing wrong?
You need to make sure that the background you copy on the initial draw (with the artist animate so it won't be drawn) is large enough to cover the entire artist on subsequent draws. This is the background and will be used to "erase" subsequent draws of the animated artist. Then you draw the artist and blit the region. When you are ready to update with new data, restore the background (this erases all the old points as long as the background region is large enough) and then redraw/reblit. JDH > > Elan > -- > Beware of bugs in the above code; I have only proved it correct, not tried it. > - Donald Knuth > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users