Using pylab interface with Agg backend?

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?

pylab manages figures for you -- you want to be sure in an application
that creates many figures and saves them to images (like a web app)
that every figure that is created is closed

  fig = figure(1)

  ...later
  close(1)

In a production app like a web application server generating graphics,
often times you don't want any magic going on behind the hood, and
pylab's stateful management of figures, the current figure, and the
current axes grates on some people who like to have full control over
object creation and destruction.

So the webapp demo shows how to use the API to manage and use
figures. It is mainly a style choice.

JDH

Thanks, I'm starting to understand. So since I am making a web app, I
should be refering to the API reference instead of the screenshots
code:
http://matplotlib.sourceforge.net/screenshots.html

If correct here, I guess I locate the API in the user guide? Is there
anything else I should be using as a reference?

-Greg

···

On 7/12/06, John Hunter <jdhunter@...4...> wrote:

In a production app like a web application server generating graphics,
often times you don't want any magic going on behind the hood, and
pylab's stateful management of figures, the current figure, and the
current axes grates on some people who like to have full control over
object creation and destruction.

So the webapp demo shows how to use the API to manage and use
figures. It is mainly a style choice.