RuntimeError: The animation function must return a sequence of Artist objects.

조회수 1246회
def animate(i):
    """The main animation function, called for each frame."""
    def animate_particle(X, ln, i):
        """Plot the trajectory of a particle up to step i."""
        ln.set_data(X[:i,0], X[:i,1])
        ln.set_3d_properties(X[:i,2])
        particles._offsets3d = np.vstack((Xe[i][:3], Xi[i][:3])).T
    animate_particle(Xe, lne, i)
    animate_particle(Xi, lni, i)

fig, ax, lne, lni, particles = init()
ani = animation.FuncAnimation(fig, animate, init_func=init, frames=5000, interval=1000, blit=True)

HTML(ani.to_html5_video())

rc('animation', html='html5')
ani


plt.show()

아마 animate 함수에 return을 추가하지 않아서 돌아가지 않는것 같습니다... 어떻게 return을 추가해야할지 감이 안옵니다.

출처는 https://nbviewer.jupyter.org/github/scipython/plasma-projects/blob/master/gyromotion/Gyromotion.ipynb 입니다.

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)