lib/matplotlib/figure.py
def colorbar(self, mappable, cax=None, ax=None, **kw):
        """
        Create a colorbar for a ScalarMappable instance.

        Documentation for the pylab thin wrapper:
        %(colorbar_doc)s
        """
        if ax is None:
            ax = self.gca()
        if cax is None:
            cax, kw = cbar.make_axes(ax, **kw)
        cax.hold(True)
        cb = cbar.Colorbar(cax, mappable, **kw)

        def on_changed(m):
            #print 'calling on changed', m.get_cmap().name
            cb.set_cmap(m.get_cmap())
            cb.set_clim(m.get_clim())
            cb.update_bruteforce(m)

        self.cbid = mappable.callbacksSM.connect('changed', on_changed)
        mappable.set_colorbar(cb, cax)
        self.sca(ax)
        return cb

        Create a colorbar for a ScalarMappable instance.

        Documentation for the pylab thin wrapper:
        %(colorbar_doc)s
        
Create a colorbar for a ScalarMappable instance.
Documentation for the pylab thin wrapper:
%(colorbar_doc)s
Create a colorbar for a ScalarMappable instance . Documentation for the pylab thin wrapper : % ( colorbar_doc ) s
def colorbar(self, mappable, cax=None, ax=None, **kw):
        if ax is None:
            ax = self.gca()
        if cax is None:
            cax, kw = cbar.make_axes(ax, **kw)
        cax.hold(True)
        cb = cbar.Colorbar(cax, mappable, **kw)
        def on_changed(m):
            cb.set_cmap(m.get_cmap())
            cb.set_clim(m.get_clim())
            cb.update_bruteforce(m)
        self.cbid = mappable.callbacksSM.connect('changed', on_changed)
        mappable.set_colorbar(cb, cax)
        self.sca(ax)
        return cb
def colorbar ( self , mappable , cax = None , ax = None , ** kw ) : if ax is None : ax = self . gca ( ) if cax is None : cax , kw = cbar . make_axes ( ax , ** kw ) cax . hold ( True ) cb = cbar . Colorbar ( cax , mappable , ** kw ) def on_changed ( m ) : cb . set_cmap ( m . get_cmap ( ) ) cb . set_clim ( m . get_clim ( ) ) cb . update_bruteforce ( m ) self . cbid = mappable . callbacksSM . connect ( 'changed' , on_changed ) mappable . set_colorbar ( cb , cax ) self . sca ( ax ) return cb
Create a colorbar for a ScalarMappable instance.
Create a colorbar for a ScalarMappable instance .
"""
        Create a colorbar for a ScalarMappable instance.

        Documentation for the pylab thin wrapper:
        %(colorbar_doc)s
        """ #print 'calling on changed', m.get_cmap().name
self
mappable
cax
ax