#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation plt.ion() img = np.random.rand(40,40) fig=plt.figure(1) image = plt.imshow(img,interpolation='nearest',animated=True,label="blah") for k in range(1,10000): img = np.random.rand(40,40) image.set_data(img) plt.draw()