how to copy matplotlib figures to clipboard

Viewed 3259

After plotting the figure, I want to copy it to the clipbaoard instead of saving to figures. I searched the internet and the code does not work, either the required modules only support python 2.x or the program stopped by not well-defined functions.

I am using Python 3.6 in Windows 10. My matplotlib version is 2.0.2. I tried 'PyGTK: copy matplotlib figure to clipboard'

and got the error: ImportError: Gtk* backend requires pygtk to be installed. I then visited www.pygtk.org/downloads.html to download pygtk/PyGObject (Windows) but it requires python 2.6 or file not found.

Can anyone show how to achieve it?

import matplotlib.pyplot as plt
a = [2,3,6,7,1]
plt.plot(a)
plt.show()
0 Answers
Related