Revision: 5141
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5141&view=rev
Author:   jdh2358
Date:     2008-05-15 11:54:23 -0700 (Thu, 15 May 2008)

Log Message:
-----------
fixed a problem with axh and vline scaling

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

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2008-05-15 13:03:49 UTC (rev 
5140)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2008-05-15 18:54:23 UTC (rev 
5141)
@@ -2449,9 +2449,14 @@
         %(Line2D)s
         """
 
+        ymin, ymax = self.get_ylim()
+        if ymax<ymin: ymin, ymax = ymax, ymin
+        scaley = (y<ymin) or (y>ymax)
+
         trans = mtransforms.blended_transform_factory(
             self.transAxes, self.transData)
-        l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, 
**kwargs)
+        l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, 
scaley=scaley, **kwargs)
+
         return l
 
     axhline.__doc__ = cbook.dedent(axhline.__doc__) % martist.kwdocd
@@ -2486,9 +2491,14 @@
         %(Line2D)s
         """
 
+        xmin, xmax = self.get_xlim()
+        if xmax<xmin: xmin, xmax = xmax, xmin
+        scalex = (x<xmin) or (x>xmax)
+
         trans = mtransforms.blended_transform_factory(
             self.transData, self.transAxes)
-        l, = self.plot([x,x], [ymin,ymax] , transform=trans, scaley=False, 
**kwargs)
+        l, = self.plot([x,x], [ymin,ymax] , transform=trans, scalex=scalex, 
scaley=False, **kwargs)
+
         return l
 
     axvline.__doc__ = cbook.dedent(axvline.__doc__) % martist.kwdocd


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: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to