...
print (data)
close_prices = data[1]
dates = data.index
fig, ax = plt.subplots()
ax.plot(dates, close_prices)
ax.set_xticklabels(dates, rotation=45)
ax.set_title(f"Daily Close Prices for IBM")
ax.set_xlabel("Date")
ax.set_ylabel("Price ($)")
plt.tight_layout()
plt.show()
...
数据是从AlphVantage API调用的,我以pandas格式输出它。如何在图表上只显示收盘价?
1条答案
按热度按时间xmjla07d1#