I´m a noobie with python, but I discover that with vscode I can´t save plots, but if I run the same code with Spyder the plot is saved to the path where the script is. Is there an option that I need to activate in VScode?
Example code:
import matplotlib.pyplot as plt
# creating plotting data
xaxis =[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
yaxis =[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# plotting
plt.plot(xaxis, yaxis)
plt.xlabel("X")
plt.ylabel("Y")
# saving the file.Make sure you
# use savefig() before show().
plt.savefig("squares.png", format="png")
plt.close()