skip to navigation
skip to content

drawnow 0.3

MATLAB-like drawnow

Latest Version: 0.71.2

### drawnow for matplotlib

Matlab® has a great feature where it allows you to update a figure. You can simply call drawnow and have your figure update. This is nice if you’re running a simulation and want to see the results every iteration. It’d sure be nice if Python/matplotlib had a similar feature to update the plot each iteration. This feature adds that functionality to matplotlib.


from drawnow import refresh

ion() # enable interactivity, can be default
x = zeros((N,N))

def function_to_draw_figure():
    #figure() # don't call, otherwise new window opened
    imshow(x) # python's global scope
    #show()   # don't call show()!

for i in arange(x):
    x.flat[i] = 1

If you want to wait for confirmation after update, call refresh(function_to_draw_figure, confirm=True).

If you only want to show the figure once, call refresh(function_to_draw_figure, show_once=True)


Two options:

  1. Download this repository and run python install.
  2. Run pip install drawnow.
File Type Py Version Uploaded on Size
drawnow-0.3.tar.gz (md5) Source 2014-05-07 2KB