2024-04-25 07:07:42 发布
网友
如何在熊猫中绘制具有不同x值的多个系列?我希望下面的方法能奏效,但它似乎能产生多个数字。在
rawdat.plot(x='ts', y=['bid','ask'], marker='.', lw=0) plot.hold() rawdat.plot(x='lastTrade', y='last', marker='x', lw=0) plt.show()
您需要通过pandas.plot接口告诉matplotlib您希望在相同的axis(see docs)上绘制:
pandas.plot
matplotlib
axis
ax = rawdat.plot(x='ts', y=['bid','ask'], marker='.', lw=0) plot.hold() rawdat.plot(x='lastTrade', y='last', marker='x', lw=0, ax=ax) plt.show()
您需要通过
pandas.plot
接口告诉matplotlib
您希望在相同的axis
(see docs)上绘制:相关问题 更多 >
编程相关推荐