I'm using the Player
class for animation as defined here. It's pretty nice insofar as it includes a playback button console, and I've used it to accomplish a variety of settings, e.g. animating heatmaps.
However, I'm having problems animating vectors created using quiver
.
I won't load all the code that defines the class itself, but here's my example, where I attempt to animate a sequence of arrows. The magnitude of the arrow at time t equals the value of the signal 2*sin(t):
fig,ax=plt.subplots(1)
t = np.linspace(0,6*np.pi, num=100)
s = 2*np.sin(t)
radius=s
x= np.multiply(radius,np.cos(t))
y =np.multiply( radius, np.sin(t))
point_vector,=ax.quiver(0,0,[],[])
def update(i):
point_vector.set_UVC(x[i],y[i])
ani = Player(fig, update, maxi=len(t)-1)
plt.show()
The error message states
ValueError: Argument U has a size 0 which does not match 1, the number of arrow
positions
which I believe arises from the quiver command itself.