contourf bug

contourf appears to be broken in matplotlib-0.84 when one attempts to use the 'colors=' kwarg. I just updated from 0.83.2, and ran a script that worked fine before.

This command fails:

contourf( var1[0,:,:], colors=(.2,.35,.5,.65,.85,1.) )

while this command:

contourf( var1[0,:,:] )

succeeds. The failure message is:

Traceback (most recent call last):
  File "./kuroshio_surface_plus.py", line 24, in ?
    contourf(var1[0,:,:], colors=contourlist)
  File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 1807, in contourf
    ret = gca().contourf(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1255, in contourf
    return self._contourHelper.contourf(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/matplotlib/contour.py", line 779, in contourf
    mappable.level_upper = lev[-1]
AttributeError: 'NoneType' object has no attribute 'level_upper'

any ideas?

Jordan Dawe

Jordan,

Correct. I sent John a patch to fix that, but it didn't make it in time for 0.84. It was a fairly large patch, not a quick fix, so John may want to ponder it, or ask me to change some things, before committing it to CVS.

Eric

Jordan Dawe wrote:

···

contourf appears to be broken in matplotlib-0.84 when one attempts to use the 'colors=' kwarg. I just updated from 0.83.2, and ran a script that worked fine before.

This command fails:

contourf( var1[0,:,:], colors=(.2,.35,.5,.65,.85,1.) )