You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify connection of the default key_press and button_press handlers.
It likely doesn't make much sense to call `key_press_handler` or
`button_press_handler` with `canvas != event.canvas` or
`toolbar != event.canvas.toolbar` (the default Toolbar constructor sets
itself as this attribute on the canvas), so we can just make these
parameters optional and fill them in from `event`. This means that
connecting these handlers is now just
`canvas.mpl_connect("key_press_event", key_press_handler)`, rather than
having to create an intermediate function to adjust the signature (see
change in embedding_in_tk_sgskip.py).
`canvas` and `toolbar` could probably even be deleted, but I'm not sure
the API change is actually worth it -- plus there may be someone
somewhere who actually has a use case for `toolbar` not matching
`event.canvas.toolbar`...
0 commit comments