get pylab figures working in mac os x
October 18th, 2010 by Lawrence David
if you’re getting the following errors while trying to use pylab:
>>> pylab.show()
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/__init__.py:41: UserWarning:
Your currently selected backend, ‘agg’ does not support show().
Please select a GUI backend in your matplotlibrc file (‘/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/mpl-data/matplotlibrc’)
or with matplotlib.use()
(backend, matplotlib.matplotlib_fname()))
try inserting the following lines in your code:
import matplotlib
matplotlib.use(‘TkAgg’)
(thanks google groups!)