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

Skip to content

Commit 3e41f32

Browse files
committed
Replace dist in widgets.py
1 parent 1305378 commit 3e41f32

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
@@ -1000,7 +999,8 @@ def _clicked(self, event):
1000999

10011000
def inside(p):
10021001
pcirc = np.array([p.center[0], p.center[1]])
1003-
return dist(pclicked, pcirc) < p.radius
1002+
d = pclicked - pcirc
1003+
return np.sqrt(np.dot(d, d)) < p.radius
10041004

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

0 commit comments

Comments
 (0)