Yes it is possible. The idea is to replace the standard plt.figure with a custom one (a method known as decapitating monkeys ) that introduces a keyboard handler to copy to the clipboard. The following code will allow you to copy any MPL digit to the clipboard by pressing Ctrl + C:
import io import matplotlib.pyplot as plt from PySide.QtGui import QApplication, QImage def add_clipboard_to_figures():
Please note that if you want to use from matplotlib.pyplot import * (for example, in an interactive session), you need to do this after executing the above code, otherwise the figure that you import into the default namespace will have an unloaded version.
source share