matplotlib/matplotlib — pull request #1426 by mdboom (2012-10-22 18:27:15+00:00)
Title: WebAgg backend

This adds a WebAgg backend based on the approach I described here:

http://mdboom.github.com/blog/2012/10/11/matplotlib-in-the-browser-its-coming/

It's not complete, but I thought I would post this early to give it lots of browser testing and make sure that the fundamental approach is sound.

This does not integrate with IPython (though that's the plan) -- it is just a standalone backend, and the only additional dependency is Tornado.

To try it out, set your backend to `WebAgg`, make a figure and call `pyplot.show()`. By default, a webbrowser tab will be opened showing the figure (though the webbrowser behavior is configurable). Some fun examples to try are `examples/animation/double_pendulum_animated.py` and `examples/event_handling/lasso.py`.

Each of the existing figures is available on its own page (just like their own window in a GUI backend), and the URLs are of the form:

```
http://127.0.0.1:8888/1/
http://127.0.0.1:8888/2/
etc...
```

I don't have a lot of experience with browser programming, so the CSS and layout is a little clunky. I'd encourage improvements there, as well as any reports of any examples that don't seem to work.