Michael: By popular demand, I put this back in 0.5.1. You
> can now pass an axes instance to any Basemap method. The
> default is 'ax=None', in which case pylab.gca is used to get
> the current one. Does this solve your problem?
You can potentially get into trouble by simply importing the pylab
module at all since pylab will try and import the default backend.
This usually isn't fatal, but isn't ideal either. I would suggest
conditionally importing pylab only if it is needed, eg when ax=None.
The use case you would be avoiding is for example when the user hasn't
changed the default backend (GTKAgg) from .matplotlibrc. They may be
using non-pylab basemap in pure agg mode over a web app server. When
you import pylab, the module will try and import pygtk, which will
fail if pygtk is not installed or if there is no X11 connection. Of
course, the user could change the default backend in the rc file, but
one point of the OO interface is to have as little magic as possible.
By conditionally importing pylab, you can avoid these kinds of