'Handle release.'

def on_release(self, event):

    if ((event.inaxes != self.line.axes) or (self.press is None)):
        return
    self.press = None
    self.line.figure.canvas.draw()
    self.callback(self.x0, event.xdata)
    self.x0 = event.xdata
