8000 MNT: add error check if not a number · matplotlib/matplotlib@ef7afc4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef7afc4

Browse files
committed
MNT: add error check if not a number
1 parent 28bc931 commit ef7afc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,10 @@ def dopatch(xs, ys, **kwargs):
39143914
positions = list(range(1, N + 1))
39153915
elif len(positions) != N:
39163916
raise ValueError(datashape_message.format("positions"))
3917+
39173918
positions = np.array(positions)
3919+
if len(positions) > 0 and not isinstance(positions[0], Number):
3920+
raise TypeError("positions should be an iterable of numbers")
39183921

39193922
# width
39203923
if widths is None:

0 commit comments

Comments
 (0)
0