microsoft/vscode-jupyter

Copy plot to clipboard (plain .py file)

BrazilForever11 opened this issue · 2 comments

Here is my code to generate a plot in plain .py file :

import matplotlib.pyplot as plt
x = [1,2,3]
y = [2,4,1]
plt.plot(x, y)  
plt.show()

When executed (Shift + Enter) it creates new window with a plot. It would be great to right click on the image and save it to clipboard. I think this functionality is already present in Jupyter Notebook, but not in plain .py file

Thank you for filing this issue,
If you need outputs similar to Jupyter in plain python files, then the only solution is to use Interactive Window.
https://code.visualstudio.com/docs/python/jupyter-support-py
Else it falls beyond the scope of VS Code.
As such functionality is provided by matplotlib and not VS Code, matplotlib has special support for running in Jupyter and displays options to copy images.