|
From: David T. <dl...@ca...> - 2009-01-17 10:05:22
|
I've been trying to add a colorbar to my figure and have used the following code; cax = axes([0.85, 0.1, 0.075, 0.8]) colorbar(cax=cax) as a template (from http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html) However I get an error: Traceback (most recent call last): File "cornwall2.py", line 640, in <module> draw_parishes(n_parishes,m_parishes,preoccratio_parishes,0,nthroot,scaling) File "cornwall2.py", line 112, in draw_parishes colorbar(cax=cax) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\pyplot.py", line 1295, in colorbar ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\figure.py", line 977, in colorbar cb = cbar.Colorbar(cax, mappable, **kw) File "c:\python25\lib\site-packages\matplotlib-0.98.3.0001-py2.5-win32.egg\matplotlib\colorbar.py", line 595, in __init__ mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax AttributeError: 'NoneType' object has no attribute 'autoscale_None' How am I using colorbar incorrectly? |