Commit 4fc30a1
committed
Deprecate support for (n, 1)-shaped error arrays in errorbar().
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).1 parent 7f4b044 commit 4fc30a1
3 files changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3199 | 3199 | | |
3200 | 3200 | | |
3201 | 3201 | | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
3202 | 3208 | | |
3203 | 3209 | | |
3204 | 3210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2899 | 2899 | | |
2900 | 2900 | | |
2901 | 2901 | | |
2902 | | - | |
| 2902 | + | |
| 2903 | + | |
2903 | 2904 | | |
2904 | 2905 | | |
2905 | 2906 | | |
| |||
5248 | 5249 | | |
5249 | 5250 | | |
5250 | 5251 | | |
5251 | | - | |
5252 | | - | |
5253 | | - | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
5254 | 5258 | | |
5255 | 5259 | | |
5256 | 5260 | | |
| |||
0 commit comments