Skip to content

Commit 7e2cb48

Browse files
committed
Make variable name more intuitive.
Renamed *x* to *y*.
1 parent d2998e6 commit 7e2cb48

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/matplotlib/mlab.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,21 +3183,21 @@ def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y):
31833183
# c3x, c3y = q2x, q2y
31843184
return q0x, q0y, c1x, c1y, c2x, c2y, q2x, q2y
31853185

3186-
def offset_line(x, xerr):
3186+
def offset_line(y, yerr):
31873187
"""
3188-
Offsets an array *x* by +/- an error and returns a tuple (x - err, x + err).
3188+
Offsets an array *y* by +/- an error and returns a tuple (y - err, y + err).
31893189
31903190
The error term can be:
31913191
31923192
o A scalar. In this case, the returned tuple is obvious.
3193-
o A vector of the same length as *x*. The quantities x +/- err are computed
3193+
o A vector of the same length as *y*. The quantities y +/- err are computed
31943194
component-wise.
3195-
o A tuple of length 2. In this case, xerr[0] is the error below *x* and
3196-
xerr[1] is error above *x*.
3197-
"""
3198-
if np.isscalar(xerr) or len(xerr) == len(x):
3199-
xmin = x - xerr
3200-
xmax = x + xerr
3201-
elif len(xerr) == 2:
3202-
xmin, xmax = x - xerr[0], x + xerr[1]
3203-
return xmin, xmax
3195+
o A tuple of length 2. In this case, yerr[0] is the error below *y* and
3196+
yerr[1] is error above *y*.
3197+
"""
3198+
if np.isscalar(yerr) or len(yerr) == len(y):
3199+
ymin = y - yerr
3200+
ymax = y + yerr
3201+
elif len(yerr) == 2:
3202+
ymin, ymax = y - yerr[0], y + yerr[1]
3203+
return ymin, ymax

0 commit comments

Comments
 (0)