I have a function
def on_key(event):
Which I call from
fig.canvas.mpl_connect('key_press_event', on_key)
I would like to pass the parameters plt1, plt2, plt3 to on_key...
how can I do this?
Probably
def on_key(event, arg1, arg2, arg3):
and
fig.canvas.mpl_connect('key_press_event', lambda event: on_key(event, plt1, plt2, plt3))
or as list
def on_key(event, args_list):
and
fig.canvas.mpl_connect('key_press_event', lambda event: on_key(event, [plt1, plt2, plt3]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With