我正在嘗試在 matplotlib 中生成一個連續生成的圖。我面臨的問題與右側 y 軸上的標簽有關。顯示的范圍是我想要的,但是還有一個附加的標簽 (0, 0.2, ... 1,0)。
def doAnimation():
fig, ax = plt.subplots()
def animate(i):
data=prices(a,b,c) #this gives a DataFrame with 2 columns (value 1 and 2)
plt.cla()
ax.plot(data.index, data.value1)
ax2 = ax.twinx()
ax2.plot(data.index, data.value2)
plt.gcf().autofmt_xdate()
plt.tight_layout()
return ax, ax2
call = FuncAnimation(plt.gcf(), animate, 1000)
return call
callSave = doAnimation()
plt.show()
任何想法如何擺脫設定:0.0、0.2、0.4、0.6、0.8、1.0?
這是圖表的外觀:

uj5u.com熱心網友回復:

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/488235.html
標籤:Python matplotlib 动画
上一篇:在css中并排對齊專案
下一篇:元素之間的影片延遲
