On Wed, Feb 3, 2010 at 5:32 AM, Luis P. Guerra <luispelay...@gmail.com> wrote: > Hi, > > I am newbie using Matplotlib. I have to do an interactive application and > before that, I am trying some tests to familiarize myself with the library. > > I am plotting some 2d data together with 2 buttons. When one of the buttons > is pressed, only a few points should be remain in the plot, and when the > other button is pressed, all the initial points should be appear again. My > problem is that when I press the first button, the points which sould be > remain, change the colour (because I specify this), but the rest of the > points also remain. How can I repaint again the plot to get what I want?
W/o a complete free standing example that we can run, it is difficult to see exactly what your problem is. If you post one, we can help you more easily. To answer some of your specific questions and point you to some solutions * to cause a full figure redraw, do fig.canvas.draw(). You can repaint portions of the canvase or selected artists using the animation techniques described at http://www.scipy.org/Cookbook/Matplotlib/Animations and http://matplotlib.sourceforge.net/users/event_handling.html with examples at http://matplotlib.sourceforge.net/examples/animation/index.html * you can "remove" a line entirely if you don't want to plot it anymore using the techniques described at http://matplotlib.sourceforge.net/users/artists.html#artist-tutorial. You can also temporarily make any artist invisible by setting obj.set_visible(False) * you can also control which points in an array are plotted by setting a masked array, as in http://matplotlib.sourceforge.net/examples/pylab_examples/masked_demo.html Hope this helps, JDH ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users