Refer to the api:
import pylab
fig = pylab.figure()
pylab.plot(pylab.rand(10), pylab.rand(10))
def onclick(event):
print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%(
event.button, event.x, event.y, event.xdata, event.ydata)
cid = fig.canvas.mpl_connect('button_press_event', onclick)
Comments
Post a Comment