Commit 2078daa
committed
Fix example's BasicUnit array conversion.
A unit is a scalar, not a length-1 array. Though `BasicUnit` implements
`__rmul__`, if multiplying by an array, the NumPy implementation will
call `__array__` instead. If the LHS is an array, everything is fine,
but if the LHS is a scalar, the previous code would incorrectly cause it
to be upcast to a 1D array. When `__getitem__` was added in matplotlib#19415,
`np.atleast_1d` started iterating each (now 1D, not scalar)
`TaggedValue`, seeing it was length 1, and made the x/y arrays into
(N, 1) instead of (N,).1 parent 1937d0b commit 2078daa
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
0 commit comments