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

Skip to content

Commit ad828e1

Browse files
committed
Remove copy of less_simple_linear_interpolation
1 parent 5f1648f commit ad828e1

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
@@ -1578,48 +1578,6 @@ def simple_linear_interpolation(a, steps):
15781578
.reshape((len(x),) + a.shape[1:]))
15791579

15801580

1581-
def less_simple_linear_interpolation(x, y, xi, extrap=False):
1582-
"""
1583-
This function provides simple (but somewhat less so than
1584-
:func:`cbook.simple_linear_interpolation`) linear interpolation.
1585-
:func:`simple_linear_interpolation` will give a list of point
1586-
between a start and an end, while this does true linear
1587-
interpolation at an arbitrary set of points.
1588-
1589-
This is very inefficient linear interpolation meant to be used
1590-
only for a small number of points in relatively non-intensive use
1591-
cases. For real linear interpolation, use scipy.
1592-
"""
1593-
x = np.asarray(x)
1594-
y = np.asarray(y)
1595-
xi = np.atleast_1d(xi)
1596-
1597-
s = list(y.shape)
1598-
s[0] = len(xi)
1599-
yi = np.tile(np.nan, s)
1600-
1601-
for ii, xx in enumerate(xi):
1602-
bb = x == xx
1603-
if np.any(bb):
1604-
jj, = np.nonzero(bb)
1605-
yi[ii] = y[jj[0]]
1606-
elif xx < x[0]:
1607-
if extrap:
1608-
yi[ii] = y[0]
1609-
elif xx > x[-1]:
1610-
if extrap:
1611-
yi[ii] = y[-1]
1612-
else:
1613-
jj, = np.nonzero(x < xx)
1614-
jj = max(jj)
1615-
1616-
yi[ii] = (y[jj] +
1617-
(xx - x[jj]) / (x[jj + 1] - x[jj]) *
1618-
(y[jj + 1] - y[jj]))
1619-
1620-
return yi
1621-
1622-
16231581
@deprecated('2.1', alternative='shutil.rmtree')
16241582
def recursive_remove(path):
16251583
if os.path.isdir(path):

0 commit comments

Comments
 (0)