python
1import matplotlib.pyplot as plt
2from matplotlib import animation, rc # 追加
3import numpy as np
4
5dt = 0.01
6fig = plt.figure()
7ims = []
8
9for i in range(int(1/dt)):
10 t = dt*i
11
12 x = np.cos(t*2*np.pi)
13 y = np.sin(t*2*np.pi)
14 im = plt.plot(x,y,color='b', marker='o', markersize=20)
15 ims.append(im)
16
17ani = animation.ArtistAnimation(fig,ims)
18rc('animation', html='jshtml') # 追加
19ani # 追加