From b5324904551933b65538a3dc491f2041a9f86641 Mon Sep 17 00:00:00 2001 From: NicolasBSN Date: Wed, 22 Mar 2017 11:13:31 +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 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/parties/Bar_Chart + Récup_mat.py b/parties/Bar_Chart + Récup_mat.py index a4c68ef..61552dc 100644 --- a/parties/Bar_Chart + Récup_mat.py +++ b/parties/Bar_Chart + Récup_mat.py @@ -28,28 +28,28 @@ def matRecup(i, param): return matR def animation_strat(): - -fig=plt.figure() -fig.suptitle('Animation des stratégies') -cmap = mpl.colors.ListedColormap(["black","green" ,"red" ,"blue" ,"yellow"]) -bounds=[0,1,2,3,4,5] -norm=mpl.colors.BoundaryNorm(bounds, cmap.N) -img=plt.imshow(matRecup(0, 'strategie'), interpolation = "nearest", cmap = cmap , norm = norm) + fig=plt.figure() + fig.suptitle('Animation des stratégies') + cmap = mpl.colors.ListedColormap(["black","green" ,"red" ,"blue" ,"yellow"]) + bounds=[0,1,2,3,4,5] + norm=mpl.colors.BoundaryNorm(bounds, cmap.N) + img=plt.imshow(matRecup(0, 'strategie'), interpolation = "nearest", cmap = cmap , norm = norm) -cb=plt.colorbar(img , cmap=cmap , norm=norm , boundaries = bounds , ticks=bounds) -labels = np.arange(1, 6, 1) -cb.set_ticklabels(labels) + cb=plt.colorbar(img , cmap=cmap , norm=norm , boundaries = bounds , ticks=bounds) + labels = np.arange(1, 6, 1) + cb.set_ticklabels(labels) -def update(next_iteration,*args): + def update(next_iteration,*args): img.set_array(matRecup(next_iteration , 'strategie')) - return [img] + return [img] -anim = animation.FuncAnimation(fig, update, frames=range(MaxIterations), interval=1000, repeat = False) -plt.show() + anim = animation.FuncAnimation(fig, update, frames=range(MaxIterations), interval=1000, repeat = False) + plt.show() +