@@ -3368,7 +3368,7 @@ def xywhere(xs, ys, mask):
33683368 ys = [thisy for thisy , b in zip (ys , mask ) if b ]
33693369 return xs , ys
33703370
3371- def extract_err (err , data ):
3371+ def extract_err (name , err , data ):
33723372 """
33733373 Private function to parse *err* and subtract/add it to *data*.
33743374
@@ -3380,20 +3380,9 @@ def extract_err(err, data):
33803380 iter (b )
33813381 except (TypeError , ValueError ):
33823382 a = b = err # Symmetric error: 1D iterable.
3383- # This could just be `np.ndim(a) > 1 and np.ndim(b) > 1`, except
3384- # for the (undocumented, but tested) support for (n, 1) arrays.
3385- a_sh = np .shape (a )
3386- b_sh = np .shape (b )
3387- if (len (a_sh ) > 2 or (len (a_sh ) == 2 and a_sh [1 ] != 1 )
3388- or len (b_sh ) > 2 or (len (b_sh ) == 2 and b_sh [1 ] != 1 )):
3383+ if np .ndim (a ) > 1 or np .ndim (b ) > 1 :
33893384 raise ValueError (
3390- "err must be a scalar or a 1D or (2, n) array-like" )
3391- if len (a_sh ) == 2 or len (b_sh ) == 2 :
3392- cbook .warn_deprecated (
3393- "3.1" , message = "Support for passing a (n, 1)-shaped error "
3394- "array to errorbar() is deprecated since Matplotlib "
3395- "%(since)s and will be removed %(removal)s; pass a 1D "
3396- "array instead." )
3385+ f"{ name } err must be a scalar or a 1D or (2, n) array-like" )
33973386 # Using list comprehensions rather than arrays to preserve units.
33983387 for e in [a , b ]:
33993388 if len (data ) != len (e ):
@@ -3405,7 +3394,7 @@ def extract_err(err, data):
34053394 return low , high
34063395
34073396 if xerr is not None :
3408- left , right = extract_err (xerr , x )
3397+ left , right = extract_err ('x' , xerr , x )
34093398 # select points without upper/lower limits in x and
34103399 # draw normal errorbars for these points
34113400 noxlims = ~ (xlolims | xuplims )
@@ -3454,7 +3443,7 @@ def extract_err(err, data):
34543443 ** eb_cap_style ))
34553444
34563445 if yerr is not None :
3457- lower , upper = extract_err (yerr , y )
3446+ lower , upper = extract_err ('y' , yerr , y )
34583447 # select points without upper/lower limits in y and
34593448 # draw normal errorbars for these points
34603449 noylims = ~ (lolims | uplims )
0 commit comments