8000 DOC: add a bit more comments · matplotlib/matplotlib@e2da0f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2da0f9

Browse files
committed
DOC: add a bit more comments
1 parent 6ccd2c1 commit e2da0f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,9 @@ def _check_1d(x):
13331333
"""Convert scalars to 1D arrays; pass-through arrays as is."""
13341334
# Unpack in case of e.g. Pandas or xarray object
13351335
x = _unpack_to_numpy(x)
1336+
# plot requires `shape` and `ndim`. If passed an
1337+
# object that doesn't provide them, then force to numpy array.
1338+
# Note this will strip unit information.
13361339
if (not hasattr(x, 'shape') or
13371340
not hasattr(x, 'ndim') or
13381341
len(x.shape) < 1):

0 commit comments

Comments
 (0)
0