Python 2.6 fix for '{}' -> '{0}'
More stringent context for matplotlib, use 'Agg' backend.
__doc__ not writable in Python 3.2, simple fix.