Following this example I tried to use a lambda function to pass my controller of my Tkinter widget through mpl_connect, located at a different frame (as the controller contains some general variables). Although I did not change the code (except adjusting for the passed through controller in the appropriate instances within the frame), my on_key_event function now behaves quite differently.
The old version, where I call mpl_connect without the lambda function behaves normally. Each key stroke calls the on_key_event instance only once.
self.canvas.mpl_connect('key_press_event', self.on_key_event)
The new version, where I attempt to pass through the controller to on_key_event with the lambda function behaves quite differently. Each key stroke seems to call the on_key_event instance multiple times (seemingly a random number smaller than 10).
self.canvas.mpl_connect('key_press_event', lambda event: self.on_key_event(event, controller))
Is this related to the lambda function behaving slightly different than I am expecting? A wrong syntax? Something differently because of the matplotlib figure embedded within Tkinter?