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

Skip to content

Commit e37dd92

Browse files
committed
Remove mlab.less_simple_linear_interpolation
1 parent 66eb504 commit e37dd92

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ in Matplotlib 2.2 has been removed. See below for a list:
2222
- `mlab.dist` (use numpy.hypot instead)
2323
- `mlab.dist_point_to_segment`
2424
- `mlab.griddata` (use scipy.interpolate.griddata)
25+
- `mlab.less_simple_linear_interpolation` (use numpy.interp)
2526
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,47 +2559,6 @@ def newfunc(val, mask, mval):
25592559
##################################################
25602560
# Linear interpolation algorithms
25612561
##################################################
2562-
@cbook.deprecated("2.2", alternative="numpy.interp")
2563-
def less_simple_linear_interpolation(x, y, xi, extrap=False):
2564-
"""
2565-
This function provides simple (but somewhat less so than
2566-
:func:`cbook.simple_linear_interpolation`) linear interpolation.
2567-
:func:`simple_linear_interpolation` will give a list of point
2568-
between a start and an end, while this does true linear
2569-
interpolation at an arbitrary set of points.
2570-
2571-
This is very inefficient linear interpolation meant to be used
2572-
only for a small number of points in relatively non-intensive use
2573-
cases. For real linear interpolation, use scipy.
2574-
"""
2575-
x = np.asarray(x)
2576-
y = np.asarray(y)
2577-
xi = np.atleast_1d(xi)
2578-
2579-
s = list(y.shape)
2580-
s[0] = len(xi)
2581-
yi = np.tile(np.nan, s)
2582-
2583-
for ii, xx in enumerate(xi):
2584-
bb = x == xx
2585-
if np.any(bb):
2586-
jj, = np.nonzero(bb)
2587-
yi[ii] = y[jj[0]]
2588-
elif xx < x[0]:
2589-
if extrap:
2590-
yi[ii] = y[0]
2591-
elif xx > x[-1]:
2592-
if extrap:
2593-
yi[ii] = y[-1]
2594-
else:
2595-
jj, = np.nonzero(x < xx)
2596-
jj = max(jj)
2597-
2598-
yi[ii] = y[jj] + (xx-x[jj])/(x[jj+1]-x[jj]) * (y[jj+1]-y[jj])
2599-
2600-
return yi
2601-
2602-
26032562
@cbook.deprecated("2.2")
26042563
def slopes(x, y):
26052564
"""

0 commit comments

Comments
 (0)