Toggling country boundaries in MPL Basemap

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? :wink:

Thanks in advance!

With warmest regards,

路路路

--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: maurobio@...287...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."

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? :wink:

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 : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory