'disconnect the callbacks'

def disconnect(self):

    for cid in self.cids:
        self.canvas.mpl_disconnect(cid)
    try:
        c1 = self._c1
    except AttributeError:
        pass
    else:
        self.canvas.mpl_disconnect(c1)
