Saving a figure toStringIO or similar

I posted this to the list a few days ago:

Using the agg backend you can obtain an RGBA buffer or RGB string which
can then be loaded as a PIL Image for processing. I've adapted a the
examples/agg_oo.py to demonstrate.

Thanks a lot, Nicolas! Excellent... no more temp file! It took me some time to figure out how to get the PNG image data from PIL, but it worked out quite well.

Sascha