我试图从pandas数据帧创建子图,时间在x轴上以hh:mm:ss表示
它在没有子地块的情况下工作,但当我尝试使用2个子地块AttributeError时,出现以下错误:“numpy.ndarray”对象没有属性“set\xticks”
如有任何建议,将不胜感激
ax = df[df.columns[6:8]].plot(figsize=(7,5), grid = True, legend = True, subplots=True, layout = (2,1), sharex = False)
ax[0].set_xticks(df.index[::60].flatten())
ax[0].set_xticklabels(df.Time[::60], rotation=90)
ax[1].set_xticks(df.index[::60].flatten())
ax[1].set_xticklabels(df.Time[::60], rotation=90)
plt.show()
目前没有回答
相关问题 更多 >
编程相关推荐