Update Bar_Chart + Récup_mat.py

This commit is contained in:
NicolasBSN 2017-03-15 10:16:00 +01:00 committed by GitHub
parent 176429dc52
commit c842287905
1 changed files with 11 additions and 8 deletions

View File

@ -20,22 +20,25 @@ def simulation():
fig=plt.figure()
fig.suptitle('Animation des stratégies')
cmap = mpl.colors.ListedColormap(["black","green","blue","red"])
bounds=[0,1,2,3]
norm=mpl.colors.BoundaryNorm(bounds, cmap.N)
im=plt.imshow(HistoriqueGrille[0], interpolation = 'nearest', cmap = cmap , norm = norm)
plt.colorbar(img, cmap=cmap , norm=norm , boundaries = bounds , thicks = bounds)
img=plt.imshow(HistoriqueGrille[0], interpolation = "nearest", cmap = cmap , norm = norm)
def update(next_iteration):
im.set_array(cells)
return im
anim = animation.FuncAnimation(fig, update, frames=range(MaxIterations), interval=50, blit=True)
def update(next_iteration,*args):
img.set_array(HistoriqueGrille[next_iteration])
return img,
anim = animation.FuncAnimation(fig, update, frames=range(4), interval=1000, blit=True)
plt.show()
def matStratIté(i):
array*str-> array
"""Récupère la matrice avec seulement le paramètre stratégie pour chaque joueur , à litération i voulue"""