发布时间:2019-09-22 07:47:38编辑:auto阅读(1752)
代码:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
fig, ax = plt.subplots()
x = np.arange(0, 2 * np.pi, 0.01)
line, = ax.plot(x, np.sin(x))
def animate(i):
line.set_ydata(np.sin(x + i / 100))
return line,
def init():
line.set_ydata(np.sin(x))
return line,
ani = animation.FuncAnimation(fig=fig, func=animate, frames=100,
init_func=init, interval=20, blit=False)
plt.show()
上一篇: python判断对象的类型(字典,列表,
下一篇: ubuntu下使用sublime tex
47831
46369
37253
34714
29299
25960
24876
19935
19518
18005
5776°
6401°
5912°
5954°
7054°
5898°
5929°
6425°
6390°
7760°