'Remove this colorbar from the figure.  If the colorbar was created with
``use_gridspec=True`` then restore the gridspec to its previous value.'

def remove(self):

    ColorbarBase.remove(self)
    self.mappable.callbacksSM.disconnect(self.mappable.colorbar_cid)
    self.mappable.colorbar = None
    self.mappable.colorbar_cid = None
    try:
        ax = self.mappable.axes
    except AttributeError:
        return
    try:
        gs = ax.get_subplotspec().get_gridspec()
        subplotspec = gs.get_topmost_subplotspec()
    except AttributeError:
        pos = ax.get_position(original=True)
        ax.set_position(pos)
    else:
        ax.set_subplotspec(subplotspec)
