import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import PillowWriter
import animatplot as amp
x = np.linspace(0, 2*np.pi, 10)
y = np.linspace(0, 2*np.pi, 5)
t = np.linspace(0, 4.9, 25)
timeline = amp.Timeline(t)
X, Y, T = np.meshgrid(x, y, t)
U = np.cos(X+T)
V = np.sin(Y+T)
ax = plt.axes(xlim=[-1, 7], ylim=[-1, 7])
block1 = amp.blocks.Quiver(X[:,:,0], Y[:,:,0], U, V, ax=ax, t_axis=2, units='inches', pivot='mid')
anim = amp.Animation([block1], timeline)
anim.toggle()
anim.timeline_slider()
anim.save('quiver.gif', writer=PillowWriter(fps=10))
plt.show()