matplotlib/matplotlib — pull request #1457 by dmcdougall (2012-11-08 00:45:09+00:00)
Title: Better object-oriented interface for users

A second attempt at addressing #1094. My initial attempt was a combination of #1125 and #1201. This went embarrassingly wrong, broke lots of things and was consequently reverted in #1221.

Here's example usage:

```python
import matplotlib
matplotlib.use('gtkagg')
from matplotlib.figure import Figure

fig = Figure()
fig.show() # pops up figure window

ax = fig.add_subplot(1, 1, 1) # add some axes

fig.update() # a convenience method that wraps around canvas.draw_idle()
```

I have tried it with Qt4, GTK and OS X backends and it seems to work. I'd like other people to test it out, though. Obviously this PR is not complete, the `update` method needs to raise exceptions in the appropriate places (non-GUI backends).

Good or bad, feedback is welcome and appreciated.