Revision: 6388
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6388&view=rev
Author:   efiring
Date:     2008-11-11 08:04:24 +0000 (Tue, 11 Nov 2008)

Log Message:
-----------
Fix autoscaling problem caused by axhline and axvline

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/axes.py

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2008-11-11 06:52:52 UTC (rev 
6387)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2008-11-11 08:04:24 UTC (rev 
6388)
@@ -1312,7 +1312,8 @@
         self._set_artist_props(line)
         line.set_clip_path(self.patch)
 
-        self._update_line_limits(line)
+        if line.get_transform() == self.transData:
+            self._update_line_limits(line)
         if not line.get_label():
             line.set_label('_line%d'%len(self.lines))
         self.lines.append(line)
@@ -2774,7 +2775,11 @@
 
         trans = mtransforms.blended_transform_factory(
             self.transAxes, self.transData)
-        l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, 
scaley=scaley, **kwargs)
+        l = mlines.Line2D([xmin,xmax], [y,y], transform=trans, **kwargs)
+        self.add_line(l)
+        self.dataLim.y0 = min(self.dataLim.y0, yy)
+        self.dataLim.y1 = max(self.dataLim.y1, yy)
+        self.autoscale_view(scalex=False, scaley=scaley)
 
         return l
 
@@ -2830,7 +2835,11 @@
 
         trans = mtransforms.blended_transform_factory(
             self.transData, self.transAxes)
-        l, = self.plot([x,x], [ymin,ymax] , transform=trans, scalex=scalex, 
scaley=False, **kwargs)
+        l = mlines.Line2D([x,x], [ymin,ymax] , transform=trans, **kwargs)
+        self.add_line(l)
+        self.dataLim.x0 = min(self.dataLim.x0, xx)
+        self.dataLim.x1 = max(self.dataLim.x1, xx)
+        self.autoscale_view(scalex=scalex, scaley=False)
 
         return l
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to