In MNELAB, I would like my raw.plot window to not close if the user hits the Esc key. Previously, I used the following hack which worked for matplotlib < 3:
try:
key_events = fig.canvas.callbacks.callbacks["key_press_event"][8]
except KeyError:
pass
else: # this requires MNE >=0.15
key_events.func.keywords["params"]["close_key"] = None
Of course this was bound to fail, and with matplotlib >= 3 key_events is now a matplotlib.cbook._StrongRef object, whereas previously it used to be a matplotlib.cbook._BoundMethodProxy object. Of course private methods can change at anytime, but does anyone know either how to make the old hack work again, or better yet how to modify/delete existing callbacks?
In MNELAB, I would like my raw.plot window to not close if the user hits the Esc key. Previously, I used the following hack which worked for matplotlib < 3:
Of course this was bound to fail, and with matplotlib >= 3
key_eventsis now amatplotlib.cbook._StrongRefobject, whereas previously it used to be amatplotlib.cbook._BoundMethodProxyobject. Of course private methods can change at anytime, but does anyone know either how to make the old hack work again, or better yet how to modify/delete existing callbacks?