@@ -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