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

Skip to content

Commit 8b54e6b

Browse files
committed
Replace dist in widgets.py
1 parent 4dfa2f1 commit 8b54e6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import numpy as np
2020
from matplotlib import rcParams
2121

22-
from .mlab import dist
2322
from .patches import Circle, Rectangle, Ellipse
2423
from .lines import Line2D
2524
from .transforms import blended_transform_factory
@@ -1031,7 +1030,8 @@ def _clicked(self, event):
10311030

10321031
def inside(p):
10331032
pcirc = np.array([p.center[0], p.center[1]])
1034-
return dist(pclicked, pcirc) < p.radius
1033+
d = pclicked - pcirc
1034+
return np.sqrt(np.dot(d, d)) < p.radius
10351035

10361036
for i, (p, t) in enumerate(zip(self.circles, self.labels)):
10371037
if t.get_window_extent().contains(event.x, event.y) or inside(p):

0 commit comments

Comments
 (0)