【发布时间】:2022-11-29 12:41:40
【问题描述】:
我正在尝试显示每个子图的图例,但它似乎不起作用。子图的右上角有一个框,但它是空的。这是我试过的代码。还有我可以放大第一个子图吗?
XWD_TO = data.iloc[:,0:1]
VAS_AX = data.iloc[:,1:2]
BTC_AUD = data.iloc[:,2:]
# Daily data chart of XWD.TO and VAS.AX (need to fix legend)
#fig = plt.figure()
fig, (ax1, ax2) = plt.subplots(2, sharex=True, sharey=True)
fig.suptitle('Daily Volatility')
ax1 = plt.subplot(211)
ax1.set_title("XWD.TO and VAS.AX")
ax1.plot(XWD_TO,c='orange')
ax1.plot(VAS_AX,c='green')
ax1.legend(loc = "upper right")
ax2 = plt.subplot(212)
ax2.set_title("BTC-AUD")
ax2.plot(BTC_AUD,c='blue')
plt.show()
【问题讨论】:
标签: matplotlib