So im new to python and have been trying to model the motion of the earth and the moon with an animation in matplotlib, the animation works really well but it wont ever actually end, is there a simple way to do this? the code is as follows:
def animate(i):
orbits()
ax1.clear()
plt.axis('equal')
ax1.plot(xMlist, yMlist)
ax2.plot(xElist, yElist)
ani = animation.FuncAnimation(fig, animate,frames=10, interval=1)
plt.show()
Like I said im reletively new to python so im really sorry if this is an easy answer but ive looked everywhere and none of the tried methods seem to work, for example setting the number of frames didnt change anything so im at a loss really.