'on mouse movement'

def motion_notify_callback(self, event):

    if (not self.showverts):
        return
    if (self._ind is None):
        return
    if (event.inaxes is None):
        return
    if (event.button != 1):
        return
    (x, y) = (event.xdata, event.ydata)
    self.poly.xy[self._ind] = (x, y)
    if (self._ind == 0):
        self.poly.xy[(-1)] = (x, y)
    elif (self._ind == (len(self.poly.xy) - 1)):
        self.poly.xy[0] = (x, y)
    self.line.set_data(zip(*self.poly.xy))
    self.canvas.restore_region(self.background)
    self.ax.draw_artist(self.poly)
    self.ax.draw_artist(self.line)
    self.canvas.blit(self.ax.bbox)
