【发布时间】:2020-09-27 19:47:25
【问题描述】:
我有以下代码:
fig = plt.figure()
ax1 = plt.subplot(211)
ax2 = plt.subplot(212, sharex = ax1)
ax2 = ax1.twinx()
num = list111.lt(-90).sum(1)
plt.yticks(fontsize = 25)
ax = num.plot(figsize=(45,25), ax=ax2, color = 'Red')
df2.plot(y = 'Close', figsize=(45,25), ax=ax1, color = 'Green')
ax1.grid()
ax.margins(x=0)
我试图在同一张图中绘制 ax1 和 ax2。我得到的是一个鬼情节:
我怎样才能摆脱第二个鬼图并将带有标签的 x 轴移动到顶部图?
【问题讨论】:
标签: python pandas matplotlib