Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 728106a

Browse files
committed
MNT: add error check if not a number
1 parent d1999b2 commit 728106a

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
@@ -3925,7 +3925,10 @@ def dopatch(xs, ys, **kwargs):
39253925
positions = list(range(1, N + 1))
39263926
elif len(positions) != N:
39273927
raise ValueError(datashape_message.format("positions"))
3928+
39283929
positions = np.array(positions)
3930+
if len(positions) > 0 and not isinstance(positions[0], Number):
3931+
raise TypeError("positions should be an iterable of numbers")
39293932

39303933
# width
39313934
if widths is None:

0 commit comments

Comments
 (0)