Update Bar_Chart + Récup_mat.py
This commit is contained in:
parent
176429dc52
commit
c842287905
|
@ -20,21 +20,24 @@ def simulation():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fig=plt.figure()
|
fig=plt.figure()
|
||||||
fig.suptitle('Animation des stratégies')
|
fig.suptitle('Animation des stratégies')
|
||||||
cmap = mpl.colors.ListedColormap(["black","green","blue","red"])
|
cmap = mpl.colors.ListedColormap(["black","green","blue","red"])
|
||||||
bounds=[0,1,2,3]
|
bounds=[0,1,2,3]
|
||||||
norm=mpl.colors.BoundaryNorm(bounds, cmap.N)
|
norm=mpl.colors.BoundaryNorm(bounds, cmap.N)
|
||||||
im=plt.imshow(HistoriqueGrille[0], interpolation = 'nearest', cmap = cmap , norm = norm)
|
img=plt.imshow(HistoriqueGrille[0], interpolation = "nearest", cmap = cmap , norm = norm)
|
||||||
plt.colorbar(img, cmap=cmap , norm=norm , boundaries = bounds , thicks = bounds)
|
|
||||||
|
|
||||||
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()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
def matStratIté(i):
|
def matStratIté(i):
|
||||||
array*str-> array
|
array*str-> array
|
||||||
|
|
Loading…
Reference in New Issue