Mauro Cavalcanti wrote:
> Dear Jeff,
>
> Thanks for your fast reply. Unfortunately, I have not been able to get
> yet working:
>
> I have a menu event like this:
>
> borders = []
> if self.MapDrawBorderItem.IsChecked():
>       borders = self.map.drawcountries()
> else:
>       self.ax.lines.remove(borders)
>        # .... redraw the map here...
>
> But I got a ValueError: list.remove(x): x not in list
>
> Any hints?
>   

Mauro:  Instead of

self.ax.lines.remove(borders)

I think should simply do

borders.remove()

-Jeff
> With best regards,
>
> 2008/12/5 Jeff Whitaker <[EMAIL PROTECTED]>:
>   
>> Mauro Cavalcanti wrote:
>>     
>>> Dear ALL,
>>>
>>> Always engaged in pushing MPL/Basemap ahead of its limits, here am I
>>> again with a humble question: I want to be able to toggle the display
>>> of country boundaries on a map using a menu option on my wxPython
>>> interface. It is quite easy to initially plotting a map without
>>> borders and then toggling them on, but I could not figure out a way to
>>> toggling them off (if possible, without redrawing the whole map). Is
>>> there any trick to do this? ;-)
>>>
>>> Thanks in advance!
>>>
>>> With warmest regards,
>>>
>>>
>>>       
>> Mauro:
>>
>> The drawcountries() method returns a matplotlib line collection.  Invoking
>> the remove() method of the line collection will remove the countries from
>> the axes instance.
>>
>> -Jeff
>>
>> --
>> Jeffrey S. Whitaker         Phone  : (303)497-6313
>> Meteorologist               FAX    : (303)497-6449
>> NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED]
>> 325 Broadway                Office : Skaggs Research Cntr 1D-113
>> Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg
>>
>>
>>     
>
>
>
>   


-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED]
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg


------------------------------------------------------------------------------
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

Reply via email to