Bug with mappable

Hi,

this used to work a couple of months ago.

In [1]: from pylab import *

In [2]: mappable=cm.ScalarMappable(cmap=cm.jet)

In [3]: mappable.set_array(array([0,1]))

In [4]: cb=colorbar(mappable, orientation=‘horizontal’)

···

exceptions.AttributeError Traceback (most recent call last)

/home/huardda/Conferences/Luxembourg/src/

/usr/local/lib/python2.4/site-packages/matplotlib/pylab.py in colorbar(mappable, cax, **kw)
340 if mappable is None:
341 mappable = gci()
–> 342 ret = gcf().colorbar(mappable, cax = cax, **kw)

343     draw_if_interactive()
344     return ret

/usr/local/lib/python2.4/site-packages/matplotlib/figure.py in colorbar(self, mappable, cax, **kw)
701 if cax is None:
702 cax, kw = cbar.make_axes(ax, **kw)
–> 703 cb = cbar.Colorbar(cax, mappable, **kw)
704 mappable.add_observer(cb)
705 mappable.set_colorbar(cb, cax)

/usr/local/lib/python2.4/site-packages/matplotlib/colorbar.py in init(self, ax, mappable, **kw)

474         kw['cmap'] = mappable.cmap
475         kw['norm'] = mappable.norm

–> 476 kw[‘alpha’] = mappable.get_alpha()
477 if isinstance(mappable, ContourSet):

478             CS = mappable

AttributeError: ScalarMappable instance has no attribute ‘get_alpha’

Ciao,

David