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

Skip to content

Commit fc1ff11

Browse files
committed
Remove mlab.offset_line
1 parent a865de7 commit fc1ff11

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
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
@@ -27,4 +27,5 @@ in Matplotlib 2.2 has been removed. See below for a list:
2727
- `mlab.stineman_interp`
2828
- `mlab.segments_intersect`
2929
- `mlab.fftsurr`
30+
- `mlab.offset_line`
3031
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,39 +2888,3 @@ def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y):
28882888
c2x, c2y = c1x + 1./3. * (q2x - q0x), c1y + 1./3. * (q2y - q0y)
28892889
# c3x, c3y = q2x, q2y
28902890
return q0x, q0y, c1x, c1y, c2x, c2y, q2x, q2y
2891-
2892-
2893-
@cbook.deprecated("2.2")
2894-
def offset_line(y, yerr):
2895-
"""
2896-
Offsets an array *y* by +/- an error and returns a tuple
2897-
(y - err, y + err).
2898-
2899-
The error term can be:
2900-
2901-
* A scalar. In this case, the returned tuple is obvious.
2902-
* A vector of the same length as *y*. The quantities y +/- err are computed
2903-
component-wise.
2904-
* A tuple of length 2. In this case, yerr[0] is the error below *y* and
2905-
yerr[1] is error above *y*. For example::
2906-
2907-
import numpy as np
2908-
import matplotlib.pyplot as plt
2909-
2910-
x = np.linspace(0, 2*np.pi, num=100, endpoint=True)
2911-
y = np.sin(x)
2912-
y_minus, y_plus = mlab.offset_line(y, 0.1)
2913-
plt.plot(x, y)
2914-
plt.fill_between(x, y_minus, y2=y_plus)
2915-
plt.show()
2916-
2917-
"""
2918-
if cbook.is_numlike(yerr) or (np.iterable(yerr) and
2919-
len(yerr) == len(y)):
2920-
ymin = y - yerr
2921-
ymax = y + yerr
2922-
elif len(yerr) == 2:
2923-
ymin, ymax = y - yerr[0], y + yerr[1]
2924-
else:
2925-
raise ValueError("yerr must be scalar, 1xN or 2xN")
2926-
return ymin, ymax

0 commit comments

Comments
 (0)