fig = plt.figure() ax = fig.gca(projection='3d') surf = ax.plot_surface(X, Y, Z) plt.show() elif event.type == KEYDOWN and event.key == K_DOWN: l = [pop.contenu[i].fitness for i in range(pop.length)] l2 = [pop.contenu[i].sharedFitness for i in range(pop.length)] plt.plot(range(pop.length), l) plt.plot(range(pop.length), l2) plt.show() elif event.type == KEYDOWN and event.key == K_e: evol = not(evol) elif event.type == VIDEORESIZE: pygame.display.set_mode((event.w, event.h), DOUBLEBUF and RESIZABLE) if evol: pop.evoluer() if (pop.generationCount % 10 == 0): pop.updateBest() pop.draw(status.police) status.draw() pygame.display.flip()