Update to matplotlib prepends 'alt' for keyrelease event.key

I updated matplotlib from v1.1 to v1.2.0 win32. I use mpl_connect to handle keys. Where I used to check keyrelease event.key, for example. 'q' or 'escape', now all keys are 'alt + q', 'alt + escape'. Any idea why?

Code example:

import matplotlib.pyplot as plt def close_fig(event): print event.key if event.key == 'q': plt.close(event.canvas.figure) fig = plt.figure() ax = fig.add_subplot(111) fig.canvas.mpl_connect('key_release_event', close_fig) data = [0,10,11,12] ax.plot(data) plt.show() 
+4
source share
1 answer

This is similar to a bug in the modifier key logic added in matplotlib v1.2. Please report this example to track issues with matplotlib https://github.com/matplotlib/matplotlib/issues/new with the above example and detailed information discussed at http://matplotlib.org/faq/troubleshooting_faq.html# getting-help . In particular, it will be very likely a database problem, so please provide the backend that you use with the OS information.

Thanks!

+2
source

All Articles