Skip to content

Commit 7fd3b7b

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR matplotlib#28987: Fix: Do not use numeric tolerances for axline special cases
1 parent 97ea6ef commit 7fd3b7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,8 @@ def get_transform(self):
15051505
points_transform.transform([self._xy1, self._xy2])
15061506
dx = x2 - x1
15071507
dy = y2 - y1
1508-
if np.allclose(x1, x2):
1509-
if np.allclose(y1, y2):
1508+
if dx == 0:
1509+
if dy == 0:
15101510
raise ValueError(
15111511
f"Cannot draw a line through two identical points "
15121512
f"(x={(x1, x2)}, y={(y1, y2)})")

0 commit comments

Comments
 (0)