Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e6c0bf

Browse files
committed
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 ........ svn path=/trunk/matplotlib/; revision=5788
1 parent 7c9e70a commit 5e6c0bf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/matplotlib/patches.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,12 @@ def getpoints(self, x1,y1,x2,y2, k):
858858
*y2*) of the returned points is *k*.
859859
"""
860860
x1,y1,x2,y2,k = map(float, (x1,y1,x2,y2,k))
861+
862+
if y2-y1 == 0:
863+
return x2, y2+k, x2, y2-k
864+
elif x2-x1 == 0:
865+
return x2+k, y2, x2-k, y2
866+
861867
m = (y2-y1)/(x2-x1)
862868
pm = -1./m
863869
a = 1

0 commit comments

Comments
 (0)