Repository navigation
Deprecate support for (n, 1)-shaped error arrays in errorbar(). - #13209
Conversation
errorbar() documents that it supports the following shapes for error
arrays:
- scalar: Symmetric +/- values for all data points.
- shape(N,): Symmetric +/-values for each data point.
- shape(2,N): Separate - and + values for each bar. First row
contains the lower errors, the second row contains the
upper errors.
- *None*: No errorbar.
Actually it also supports (N, 1)-shaped arrays (treating them as shape
(N,)), but this support is broken for N=2 *at least* since Matplotlib
1.5:
N = 2; errorbar(range(N), range(N), np.arange(N).reshape((N, 1)))
...
ValueError: In safezip, len(args[0])=2 but len(args[1])=1
(This works for other values of N.)
Instead of further maintaining code to handle that case, just deprecate
it (no one has apparently noticed the N=2 bug, suggesting that this
(mis)feature is not much used anyways).
|
I think this is OK. Not sure though if there is a community that has Nx1 matrices. I probably did for the first year or so after switching from Matlab... |
|
And then you saw the light? :p |
|
Well I am now used to the numpy way, but when I took matrix algebra there was a difference between an Nx1 and a 1xN vector that is less explicit in numpy. |
|
In linear algebra, yes, but most often the data we're plotting is not a vector in a linear algebra sense (you're not intending to matrix-multiply it by some matrix, for example); they're just... a list (in the non-technical sense) of data points. |
…or arrays in errorbar().
…209-on-v3.1.x Backport PR #13209 on branch v3.1.x (Deprecate support for (n, 1)-shaped error arrays in errorbar().)
errorbar() documents that it supports the following shapes for error
arrays:
Actually it also supports (N, 1)-shaped arrays (treating them as shape
(N,)), but this support is broken for N=2 at least since Matplotlib
1.5:
(This works for other values of N.)
Instead of further maintaining code to handle that case, just deprecate
it (no one has apparently noticed the N=2 bug, suggesting that this
(mis)feature is not much used anyways).
PR Summary
PR Checklist