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

Skip to content

Commit 9ae6f0e

Browse files
committed
Prefer tr1-tr2 to tr1+tr2.inverted().
As discussed elsewhere, the first form is both faster and more accurate as it can handle exact cancellations.
1 parent e24244c commit 9ae6f0e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/lines.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,8 +1432,7 @@ def __init__(self, xy1, xy2, slope, **kwargs):
14321432

14331433
def get_transform(self):
14341434
ax = self.axes
1435-
points_transform = (self._transform + ax.transData.inverted() +
1436-
ax.transScale)
1435+
points_transform = self._transform - ax.transData + ax.transScale
14371436

14381437
if self._xy2 is not None:
14391438
# two points were given

0 commit comments

Comments
 (0)