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

Skip to content

Commit 6e5b1bd

Browse files
committed
Remove copy of less_simple_linear_interpolation
1 parent 1b348be commit 6e5b1bd

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,48 +1594,6 @@ def simple_linear_interpolation(a, steps):
15941594
.reshape((len(x),) + a.shape[1:]))
15951595

15961596

1597-
def less_simple_linear_interpolation(x, y, xi, extrap=False):
1598-
"""
1599-
This function provides simple (but somewhat less so than
1600-
:func:`cbook.simple_linear_interpolation`) linear interpolation.
1601-
:func:`simple_linear_interpolation` will give a list of point
1602-
between a start and an end, while this does true linear
1603-
interpolation at an arbitrary set of points.
1604-
1605-
This is very inefficient linear interpolation meant to be used
1606-
only for a small number of points in relatively non-intensive use
1607-
cases. For real linear interpolation, use scipy.
1608-
"""
1609-
x = np.asarray(x)
1610-
y = np.asarray(y)
1611-
xi = np.atleast_1d(xi)
1612-
1613-
s = list(y.shape)
1614-
s[0] = len(xi)
1615-
yi = np.tile(np.nan, s)
1616-
1617-
for ii, xx in enumerate(xi):
1618-
bb = x == xx
1619-
if np.any(bb):
1620-
jj, = np.nonzero(bb)
1621-
yi[ii] = y[jj[0]]
1622-
elif xx < x[0]:
1623-
if extrap:
1624-
yi[ii] = y[0]
1625-
elif xx > x[-1]:
1626-
if extrap:
1627-
yi[ii] = y[-1]
1628-
else:
1629-
jj, = np.nonzero(x < xx)
1630-
jj = max(jj)
1631-
1632-
yi[ii] = (y[jj] +
1633-
(xx - x[jj]) / (x[jj + 1] - x[jj]) *
1634-
(y[jj + 1] - y[jj]))
1635-
1636-
return yi
1637-
1638-
16391597
@deprecated('2.1', alternative='shutil.rmtree')
16401598
def recursive_remove(path):
16411599
if os.path.isdir(path):

0 commit comments

Comments
 (0)