import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
fig=plt.figure()
ax1=fig.add_subplot(1,1,1)
def animate():
data = np.loadtxt("new.txt")
ax1.plot(data[:,0], data[:,1])
return
ani=animation.FuncAnimation(fig,animate,frames=1000)
plt.show()
誤差坡平了是 類型錯誤:動畫()沒有參數(1給出) 做什麼?動態圖使用matplotlib
從'animate'(我從來沒有使用它)刪除括號'()',但這是文檔說的。而事實上這兩個錯誤都是一些姓名錯字。 .. – Hima