import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig = plt.figure()
axis = plt.axes(xlim=(-4, 4), ylim=(-3, 3))
line, = axis.plot([], [], lw=2)
def init():
line.set_data([], [])
return line,
def animate(i):
y = omega[i]*np.sin(x)
line.set_data(x, y)
return line,
x = np.arange(-4, 4+0.001, 0.001)
domega = 0.25
omega = np.arange(-3, 3+domega, domega)
anim = FuncAnimation(fig, animate, init_func=init, frames=omega.size, interval=70, blit=False)
plt.show()
I want to change the setting of animation graph, like a color and marker plot. How to modify it in FuncAnimation?