Connect event with string s to func. The signature of func is:
where event is a
matplotlib.backend_bases.Event. The following events are recognized
For the location events (button and key press/release), if the mouse is over the axes, the variable
event.inaxes will be set to the
Axes the event occurs is over, and additionally, the variables
event.ydata will be defined. This is the mouse location in data coords. See
MouseEvent for more info.
Return value is a connection id that can be used with
def on_press(event): print('you pressed', event.button, event.xdata, event.ydata) cid = canvas.mpl_connect('button_press_event', on_press)
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.