Mauro Cavalcanti wrote: > Dear ALL, > > Am I intending to change the world's geography? No, not quite. I just > would like to know how to deal with the following problem, I have > stumbled upon in MPL/Basemap: I have a line: > > continents = map.fillcontinents(color='coral, lake_color='blue') > > where map is, of course, a Basemap instance > > According to the Basemap documentation, the Basemap.fillcontinents() > method returns a matplotlib.patches.Polygon object. > > Later on, I do the following, in an attempt to erase this object: > > del continents > > But nothing happens. > > If I try instead continents.remove(), I got an error message: > TypeError: remove() takes exactly one argument (0 given) what is not > suprising as the objet returned by fillcontinents() is not a list. > > Any hints? > > Thanks in advance! > > With best wishes, > > Mauro: That's a bug - the fillcontinents method was only returning the last Polygon instance drawn. I've fixed it in SVN (r6579) to return a list of all the Polygon instances. You can now iterate over that list and remove each Polygon, like this
contpolys = m.fillcontinents() for contpoly in contpolys: contpoly.remove() Thanks for the bug report. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users