Tight axis after deletion of image

Hi,

i have an application showing some pseudo color plots as images using
imshow. After deleting an image and calling ax.axis('tight') the limits
of the axes are not updated correctly. Is this a bug, incorrect use or
intended? The behavior is demonstrated in the appended script.

Best regards,
Armin

-----8<-----------------
#!/usr/bin/env python
from pylab import *

a = rand(5,5)
ax = axes()
ax.imshow(a,extent=(0,5,0,5))
ax.imshow(a,extent=(5,10,5,10))
ax.axis('tight')
waitforbuttonpress()

ax.images.pop(0)
ax.axis('tight')
show()
-----8<-----------------

Armin Moser schrieb:

Hi,

i have an application showing some pseudo color plots as images using
imshow. After deleting an image and calling ax.axis('tight') the limits
of the axes are not updated correctly. Is this a bug, incorrect use or
intended? The behavior is demonstrated in the appended script.

It looks like calling ax.relim() is the preferred way of setting limits
after deleting artists. Unfortunately this method does only consider
patches and lines. I added some lines in axes.py to support images to
(the patch against the current svn-version is appended).

If this is not the correct place for submitting patches please tell me
where I should put it instead.

Thanks and best regards
Armin

patch_relim_images (774 Bytes)