basemap and transparent png output

Hi, I'm developing a websuite for open meshed networks

    > written in django. I must admit, matplotlib and such was
    > kinda hard stuff to step into. Most examples and
    > documentation is only based on the pylab api, which isn't
    > well suited for my purpos, because Django runs best with
    > mod-python.

There are a few resources


and Ken McIvorhas converted many of the pylab examples to OO style (link?)

See also


    > Anyways. I'm wrote a function which generates tiles for
    > google maps and those should be overlayers with
    > transparent background.

    > My code currently looks like this:

    > from matplotlib.toolkits.basemap import Basemap from
    > matplotlib.backends.backend_agg import FigureCanvasAgg as
    > FigureCanvas from matplotlib.figure import Figure

    > [...]

    > def mktopo(ll_lng, ll_lat, ur_lng, ur_lat, aspect,
    > filename, state): """Generates atopo tile for given
    > latitude/longitude pairs""" dpi = 64 fig = Figure() canvas
    > = FigureCanvas(fig) # what does this do ???
    > #fig.set_facecolor((1.0,1.0,0,0.0))

To make the figure background transparent, do:


You can set the alpha channel of any matplotlib artist (Text, Line2D,
Rectangle, etc.). The two of most interest to you will be

  fig.figurePatch (a rectangle)


  ax.axesPatch (ditto)