>キャンバス上でクリックした場所に垢移転

class Index(object):
def __init__(self, ax):
self.ax = ax

def next(self, event):
xdata = event.xdata
ydata = event.ydata
self.ax.plot(xdata, ydata, color="red", marker="o")
plt.draw()

(略)
axnext = plt.axes([0.81, 0.05, 0.1, 0.075])
fig.canvas.mpl_connect('button_press_event', Index(ax).next)
(略)

#最初にクリックしたときだけ、どの場所クリックしても中央になるのは座標軸の方が変化するからっぽい。