Is is possible to add a custom marker in an animation in Python?
I have to make a model of the Solar System, and I want to make the marker for Earth a drawing of the Earth.
Is tried to use marker = 'picture' But it didnt work
%%capture
fig, a = plt.subplots(1,1 , figsize=(10,10))
a.plot(xs_VoyA,ys_VoyA,'k-', alpha = 0.3)
a.plot(xs_Jord,ys_Jord,'k-',alpha = 0.3)
a.grid()
a.plot(0,0,'y*',ms = 50)
a.axis('equal')
picture = get_sample_data('Jorden_billed.png')
Voy, = a.plot([],[],'ko',ms = 5,lw = 3, color = 'k')
Jord, = a.plot([],[], mrker = 'picture')
def AniA(i):
Voy.set_data(xs_VoyA[i],ys_VoyA[i])
Jord.set_data(xs_Jord[i],ys_Jord[i])
return Voy, Jord,
AnA = animation.FuncAnimation(fig,
AniA,
frames=len(xs_VoyA),
interval=10,
blit=True)
I get the error message: matplotlib does not support generators as input
Does anyone know how to do this? Thank you :)