Код: Выделить всё
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig = plt.figure()
axis = plt.axes(xlim=(-4, 4), ylim=(-40, 40))
line, = axis.plot([], [], lw=3)
def init():
line.set_data([], [])
return line,
def animate(omega):
x = np.linspace(-4, 4, 8000)
y = omega*x**2
line.set_data(x, y)
return line,
anim = FuncAnimation(fig, animate, init_func=init, frames=500, interval=100, blit=True)
plt.show()

Подробнее здесь: https://stackoverflow.com/questions/786 ... rom-3-to-3