我想在 y=0 上畫一條線。但是,我不確定如何使用 Pandas 內置圖表來做到這一點。
df.mean(axis=1).plot()我正在運行這個,這就是結果。

uj5u.com熱心網友回復:
捕獲由ax回傳的實體plot,您可以使用axhline:
ax = df.mean(axis=1).plot()
ax.axhline(0, c='r')
輸出:

轉載請註明出處,本文鏈接:https://www.uj5u.com/net/340515.html
標籤:熊猫 数据框 matplotlib 阴谋 时间序列
