I am not sure if this is related, but maybe it can give you a hint. I looked at the copy_from_bbox/restore/draw_artist code a long time ago, and if I remember correctly by calling restore_region function, you're drawing directly onto the canvas. In contrast, if you do e.g. plot(x,y), you're not drawing directly; you're just telling matplotlib what you want to plot, but the actual plotting is done by matplotlib by calling figure.draw(renderer). Typically, this happens from inside the event loop, which is how things are supposed to be. On the other hand, restore_region bypasses the event loop, which is usually not a good idea.
--Michiel --- On Wed, 5/6/09, Elan Pavlov <epav...@gmail.com> wrote: > From: Elan Pavlov <epav...@gmail.com> > Subject: [Matplotlib-users] Wxpython, Matplotlib and draw_artist > To: matplotlib-users@lists.sourceforge.net > Date: Wednesday, May 6, 2009, 2:05 PM > 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? > > 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