I have some data from an experiment, and would like to save them as PNG. To display the data, I simply do show()
. However, I would like to save directly as PNG to not get print out of the screen.
How do I display my data:
import matplotlib.pyplot as plt
data = (
(1,1),
(2,2),
(3,4),
(4,7)
# mais umas 300 linhas de dados do experimento...
)
x = [d[0] for d in data]
y = [d[1] for d in data]
plt.plot(x,y)
plt.show()
How do I save the image?