This section describes how to add interactivity by capturing mouse events along with capturing keyboard clicks.
Event handling with plot callbacks
How to add interactivity by capturing mouse events
Initially, you must import everything that we normally use and use the interactive Notebook backend. Now, the user is not familiar with asynchronous programming with the callback function. This takes in an event, which is then called when that event occurs. The important information of that event is passed as an argument to that function.
We will begin by defining a function called draw_circle (event). These are the events that are passed by Matplotlib callbacks, and they include information about the event. So, in the case of a...