I want to save a matplotlib
chart so I can reference it later as an email attachment.
Following is the code to create the chart; I tried using savefig()
. It creates a file but the file is empty when I open it.
Can someone tell me what I've done wrong?
x = (list(today['STOCH'][60:104]))
plt.plot(x,label='Stochastics')
plt.ylabel('STOCH')
plt.xlabel('60 Min Chart\n78 Ticks per Day')
plt.title(stock)
plt.legend()
plt.show()
plt.savefig('stoch.png')