10000 added Tuukka's YAArrow fix for horiz and vertical lines · cirosantilli/matplotlib@25c2c95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25c2c95

Browse files
committed
added Tuukka's YAArrow fix for horiz and vertical lines
svn path=/branches/v0_91_maint/; revision=5787
1 parent c5c511e commit 25c2c95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/patches.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,12 @@ def getpoints(self, x1,y1,x2,y2, k):
712712
and the distance from x2,y2 ot the returned points is k
713713
"""
714714
x1,y1,x2,y2,k = map(float, (x1,y1,x2,y2,k))
715+
716+
if y2-y1 == 0:
717+
return x2, y2+k, x2, y2-k
718+
elif x2-x1 == 0:
719+
return x2+k, y2, x2-k, y2
720+
715721
m = (y2-y1)/(x2-x1)
716722
pm = -1./m
717723
a = 1

0 commit comments

Comments
 (0)
0