Skip to content

Instantly share code, notes, and snippets.

@e-mon
Created October 13, 2014 05:58
Show Gist options
  • Save e-mon/72dd8f636459aa230e68 to your computer and use it in GitHub Desktop.
Save e-mon/72dd8f636459aa230e68 to your computer and use it in GitHub Desktop.
matplotでfigureを'q'で閉じるためのワンライナー(暫定版)
from pylab import *
gcf().canvas.mpl_connect('key_press_event', lambda event: event.key == 'q' and close(event.canvas.figure))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment