March 2019
Intermediate to advanced
532 pages
13h 2m
English
You can see in the previous example that we have not used Matplotlib to show the image. This is because Matplotlib can also deal with event handling and picking. Therefore, you can use Matplotlib capabilities to capture mouse events. There are more events that we can connect with Matplotlib (https://matplotlib.org/users/event_handling.html). For example, in connection with the mouse, we can connect with the following events—button_press_event, button_release_event, motion_notify_event, and scroll_event.
We are going to show a simple example in order to render a circle when a mouse click is performed connecting with the button_press_event event:
# 'button_press_event' is a MouseEvent where a mouse botton is ...