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

Skip to content

Commit cf7d02d

Browse files
committed
Remove mlab.dist, mlab.dist_point_to_segment
1 parent aed15da commit cf7d02d

File tree

3 files changed

+4
-40
lines changed

3 files changed

+4
-40
lines changed

doc/api/next_api_changes/2018-09-18-DS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ in Matplotlib 2.2 has been removed. See below for a list:
1919
- `mlab.bivariate_normal`
2020
- `mlab.get_xyz_where`
2121
- `mlab.get_sparse_matrix`
22+
- `mlab.dist` (use numpy.hypot instead)
23+
- `mlab.dist_point_to_segment`
2224
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,44 +1194,6 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
11941194
return Cxy, f
11951195

11961196

1197-
@cbook.deprecated('2.2', 'numpy.hypot')
1198-
def dist(x, y):
1199-
"""
1200-
Return the distance between two points.
1201-
"""
1202-
d = x-y
1203-
return np.sqrt(np.dot(d, d))
1204-
1205-
1206-
@cbook.deprecated('2.2')
1207-
def dist_point_to_segment(p, s0, s1):
1208-
"""
1209-
Get the distance of a point to a segment.
1210-
1211-
*p*, *s0*, *s1* are *xy* sequences
1212-
1213-
This algorithm from
1214-
http://geomalgorithms.com/a02-_lines.html
1215-
"""
1216-
p = np.asarray(p, float)
1217-
s0 = np.asarray(s0, float)
1218-
s1 = np.asarray(s1, float)
1219-
v = s1 - s0
1220-
w = p - s0
1221-
1222-
c1 = np.dot(w, v)
1223-
if c1 <= 0:
1224-
return dist(p, s0)
1225-
1226-
c2 = np.dot(v, v)
1227-
if c2 <= c1:
1228-
return dist(p, s1)
1229-
1230-
b = c1 / c2
1231-
pb = s0 + b * v
1232-
return dist(p, pb)
1233-
1234-
12351197
@cbook.deprecated('2.2')
12361198
def segments_intersect(s1, s2):
12371199
"""

lib/matplotlib/pylab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@
231231

232232
from matplotlib.mlab import (
233233
amap, base_repr, binary_repr, csv2rec,
234-
demean, detrend, detrend_linear, detrend_mean, detrend_none, dist,
235-
dist_point_to_segment, distances_along_curve, exp_safe,
234+
demean, detrend, detrend_linear, detrend_mean, detrend_none,
235+
distances_along_curve, exp_safe,
236236
fftsurr, frange, griddata,
237237
identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm,
238238
l2norm, log2, movavg, norm_flat,

0 commit comments

Comments
 (0)