From c842287905ee20b2981177635ed32f7e2392701d Mon Sep 17 00:00:00 2001 From: NicolasBSN Date: Wed, 15 Mar 2017 10:16:00 +0100 Subject: [PATCH] =?UTF-8?q?Update=20Bar=5FChart=20+=20R=C3=A9cup=5Fmat.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parties/Bar_Chart + Récup_mat.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/parties/Bar_Chart + Récup_mat.py b/parties/Bar_Chart + Récup_mat.py index 656bb19..efc7e10 100644 --- a/parties/Bar_Chart + Récup_mat.py +++ b/parties/Bar_Chart + Récup_mat.py @@ -20,21 +20,24 @@ 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) - -def update(next_iteration): - im.set_array(cells) - return im +img=plt.imshow(HistoriqueGrille[0], interpolation = "nearest", cmap = cmap , norm = norm) -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