Seems upgrading basemap to V 1.0 has solved it. So now I have: In [1]: import mpl_toolkits.basemap as Basemap In [2]: Basemap.__version__ Out[2]: '1.0' In [3]: import matplotlib as mpl In [4]: mpl.__version__ Out[4]: '1.0.0'
And the tutorial runs smoothly. --john On Thu, Oct 28, 2010 at 10:30 PM, Benjamin Root <ben.r...@ou.edu> wrote: > On Thu, Oct 28, 2010 at 3:16 PM, John <washa...@gmail.com> wrote: >> >> Hello, I've been using basemap with plt.colorbar for sometime, but I >> just recently started to have the problem of: >> AttributeError: 'NoneType' object has no attribute 'autoscale_None' >> >> I ran the fcstmaps.py example (GREAT EXAMPLE by the way), and here is >> the full error I get: >> >> Traceback (most recent call last): >> File "fcstmaps.py", line 92, in <module> >> plt.colorbar(cax=cax, orientation='horizontal') >> File "/matplotlib/pyplot.py", line 1519, in colorbar >> ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) >> File "/matplotlib/figure.py", line 1180, in colorbar >> cb = cbar.Colorbar(cax, mappable, **kw) >> File "/matplotlib/colorbar.py", line 706, in __init__ >> mappable.autoscale_None() # Ensure mappable.norm.vmin, vmax >> AttributeError: 'NoneType' object has no attribute 'autoscale_None' >> >> I did upgrade matplotlib recently to version 1.0.0 >> >> Basemap is 0.99.4 >> >> Thanks, >> john >> > > John, > > It appears the problem is in matplotlib, somehow... Could you verify which > version of matplotlib is actually being loaded by executing the following > commands in python? > > import matplotlib > print matplotlib.__version__ > > Currently, in version 1.0.0, the beginning of the pyplot.colorbar() function > checks to see if mappable is None. If not, then sets mappable to gci(). > So, either you are running an older code that did not do this, or gci() is > returning a None, which is curious... > > Ben Root > > -- Configuration `````````````````````````` Plone 2.5.3-final, CMF-1.6.4, Zope (Zope 2.9.7-final, python 2.4.4, linux2), Python 2.6 PIL 1.1.6 Mailman 2.1.9 Postfix 2.4.5 Procmail v3.22 2001/09/10 Basemap: 0.99.4 Matplotlib: 1.0.0 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users