(figure, parameter)
Update the figure at every iteration.
Update the figure at every iteration.
Update the figure at every iteration .
def update(figure, parameter):
    """Update the figure at every iteration."""
    # We initialize the iteration to 0 at the beginning.
    if not hasattr(figure, 'iteration'):
        figure.iteration = 0
    # We iterate the matrix.
    mat[:,:,0] = iterate(mat[:,:,0])
    # We update the texture and the iteration text.
    figure.set_data(texture=mat, visual='image')
    figure.set_data(text="Iteration %d" % figure.iteration, visual='iteration')
    figure.iteration += 1
def update ( figure , parameter ) : # We initialize the iteration to 0 at the beginning. if not hasattr ( figure , 'iteration' ) : figure . iteration = 0 # We iterate the matrix. mat [ : , : , 0 ] = iterate ( mat [ : , : , 0 ] ) # We update the texture and the iteration text. figure . set_data ( texture = mat , visual = 'image' ) figure . set_data ( text = "Iteration %d" % figure . iteration , visual = 'iteration' ) figure . iteration += 1