|
From: John H. <jd...@gm...> - 2010-07-13 23:46:56
|
On Mon, Jul 12, 2010 at 5:06 PM, K.-Michael Aye <kmi...@gm...> wrote: > On 2010-07-12 23:17:19 +0200, John Hunter said: > >> On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye >> <kmi...@gm...> wrote: >>> Dear all, >>> >>> I'm not sure if this is by design or a problem: It's by design and is not a leak. matplotlib supports multiple images on the same axes, and can composite multiple images that overlap the same space using transparency, so each call to imshow is adding additional data to the axes. You can inspect the ax.images list to see the list of images is growing. If you have an Image object and want to remove it from the Axes, call im.remove() or you can manipulate the list of ax.images directly, eg del ax.images[0] or if you have a single image and want to update the data in it, you can do im = ax.imshow(something) im.set_array(newdata) to update the array in the existing image. JDH |