Registers a function to be run when a key is pressed in a Matplotlib visualizer.
fn will run if
key is pressed at any time when the plot window is in focus. To narrow the focus to a particular plot, define
catchKeypress() in a subclass of
key — str, required
The key to listen for. The string must be one character; other strings, or strings not corresponding to a single key, will be ignored.
fn — func(model, event), required
A function to run when
keyis pressed in the Matplotlib visualization.
modelis the model object, and
eventis the Matplotlib event object.