| 
     
      
      
      From: <jd...@us...> - 2008-07-18 14:49:15
      
     
   | 
Revision: 5788
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5788&view=rev
Author:   jdh2358
Date:     2008-07-18 14:49:09 +0000 (Fri, 18 Jul 2008)
Log Message:
-----------
Merged revisions 5787 via svnmerge from 
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
  r5787 | jdh2358 | 2008-07-18 09:46:32 -0500 (Fri, 18 Jul 2008) | 1 line
  
  added Tuukka's YAArrow fix for horiz and vertical lines
........
Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/patches.py
Property Changed:
----------------
    trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
   - /branches/v0_91_maint:1-5771
   + /branches/v0_91_maint:1-5787
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2008-07-18 14:46:32 UTC (rev 5787)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2008-07-18 14:49:09 UTC (rev 5788)
@@ -858,6 +858,12 @@
         *y2*) of the returned points is *k*.
         """
         x1,y1,x2,y2,k = map(float, (x1,y1,x2,y2,k))
+
+        if y2-y1 == 0:
+            return x2, y2+k, x2, y2-k
+        elif x2-x1 == 0:
+            return x2+k, y2, x2-k, y2
+
         m = (y2-y1)/(x2-x1)
         pm = -1./m
         a = 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |