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
--- C:\DOKUME~1\ArminM\LOKALE~1\Temp\axes.py-revBASE.svn001.tmp.py      Mi Apr 
22 11:40:58 2009
+++ C:\Dokumente und Einstellungen\ArminM\Eigene 
Dateien\matplotlib_trunk\matplotlib\lib\matplotlib\axes.py     Mi Apr 22 
11:40:49 2009
@@ -1430,6 +1430,14 @@
         for p in self.patches:
             self._update_patch_limits(p)
 
+        for im in self.images:
+            self._update_image_limits(im)
+
+    def _update_image_limits(self,im):
+        xmin,xmax,ymin,ymax = im.get_extent()
+        corners = (xmin,ymin),(xmax,ymax)
+        self.update_datalim(corners)
+
     def update_datalim(self, xys, updatex=True, updatey=True):
         'Update the data lim bbox with seq of xy tups or equiv. 2-D array'
         # if no data is set currently, the bbox will ignore its
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to