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

Skip to content

Commit 8aa540b

Browse files
committed
Remove mlab.cross_from_above and mlab.cross_from_below
1 parent 9a9f5a8 commit 8aa540b

File tree

2 files changed

+2
-62
lines changed

2 files changed

+2
-62
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
@@ -32,4 +32,6 @@ in Matplotlib 2.2 has been removed. See below for a list:
3232
- `mlab.vector_lengths`
3333
- `mlab.distances_along_curve`
3434
- `mlab.path_length`
35+
- `mlab.cross_from_above`
36+
- `mlab.cross_from_below`
3537
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,65 +2764,3 @@ def contiguous_regions(mask):
27642764
True and we cover all such regions
27652765
"""
27662766
return cbook.contiguous_regions(mask)
2767-
2768-
2769-
@cbook.deprecated("2.2")
2770-
def cross_from_below(x, threshold):
2771-
"""
2772-
return the indices into *x* where *x* crosses some threshold from
2773-
below, e.g., the i's where::
2774-
2775-
x[i-1]<threshold and x[i]>=threshold
2776-
2777-
Example code::
2778-
2779-
import matplotlib.pyplot as plt
2780-
2781-
t = np.arange(0.0, 2.0, 0.1)
2782-
s = np.sin(2*np.pi*t)
2783-
2784-
fig, ax = plt.subplots()
2785-
ax.plot(t, s, '-o')
2786-
ax.axhline(0.5)
2787-
ax.axhline(-0.5)
2788-
2789-
ind = cross_from_below(s, 0.5)
2790-
ax.vlines(t[ind], -1, 1)
2791-
2792-
ind = cross_from_above(s, -0.5)
2793-
ax.vlines(t[ind], -1, 1)
2794-
2795-
plt.show()
2796-
2797-
See Also
2798-
--------
2799-
:func:`cross_from_above` and :func:`contiguous_regions`
2800-
2801-
"""
2802-
x = np.asarray(x)
2803-
ind = np.nonzero((x[:-1] < threshold) & (x[1:] >= threshold))[0]
2804-
if len(ind):
2805-
return ind+1
2806-
else:
2807-
return ind
2808-
2809-
2810-
@cbook.deprecated("2.2")
2811-
def cross_from_above(x, threshold):
2812-
"""
2813-
return the indices into *x* where *x* crosses some threshold from
2814-
below, e.g., the i's where::
2815-
2816-
x[i-1]>threshold and x[i]<=threshold
2817-
2818-
See Also
2819-
--------
2820-
:func:`cross_from_below` and :func:`contiguous_regions`
2821-
2822-
"""
2823-
x = np.asarray(x)
2824-
ind = np.nonzero((x[:-1] >= threshold) & (x[1:] < threshold))[0]
2825-
if len(ind):
2826-
return ind+1
2827-
else:
2828-
return ind

0 commit comments

Comments
 (0)