시간이 지남에 따라 색상이 변경되도록 원형 배열에 애니메이션을 적용하려고합니다.python/matplotlib의 패치 객체에 애니메이션 적용
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
nx = 20
ny = 20
fig = plt.figure()
plt.axis([0,nx,0,ny])
ax = plt.gca()
ax.set_aspect(1)
for x in range(0,nx):
for y in range(0,ny):
ax.add_patch(plt.Circle((x+0.5,y+0.5),0.45,color='r'))
plt.show()
이 어떻게 (기능 초기화 정의) 내가 예를 이용한 애니메이션을 생성 할 수 있도록) (애니메이션 않는다 :
animation.FuncAnimation(fig, animate, initfunc=init,interval=200, blit=True)
참조 코멘트 [이 질문] (http://stackoverflow.com/questions/19955073/simple-matplotlib-animation) :이 같은 애니메이션 원의 색상으로 변경할 수 있습니다 예 : –