Using pylab interface with Agg backend?

Hi guys, Is this possible? Specifically I'm trying

    > implement something close to this example:
    > http://matplotlib.sourceforge.net/examples/webapp_demo.py

    > But would like to be able to utilize code found in
    > samples like this:
    > http://matplotlib.sourceforge.net/screenshots/pie_demo.py

You just have to tell matplotlib to use Agg as your backend -- pylab
will respect the default backend, whether it is a GUI, Agg or PS.

There are several ways to choose the backend

  * make it permanent by setting your backend to 'Agg' in matplotlibrc

  * change it on a per script basis exterally by launching with the -d
    option

     > python myscript.py -dAgg
     > python myscript.py -dPS
     > python myscript.py -dGTKAgg

  * probably best for a web app, use the matplotlib "use directive".
    This must be done *before* importing pylab

    import matplotlib
    matplotlib.use('Agg')
    import pylab
    plot and save....

This is discussed at http://matplotlib.sf.net/backends.html

JDH

So my only remaining point of confusion is why wasn't the pylab
interface used in the demo here:

    > http://matplotlib.sourceforge.net/examples/webapp_demo.py

Is it just a style choice?