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

Skip to content

Commit 5258ec0

Browse files
committed
FIX: allow singleton labels in hist
1 parent a2d2b80 commit 5258ec0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6758,6 +6758,8 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
67586758
labels = [None]
67596759
elif isinstance(label, str):
67606760
labels = [label]
6761+
elif not np.iterable(label):
6762+
labels = [str(label)]
67616763
else:
67626764
labels = [str(lab) for lab in label]
67636765

0 commit comments

Comments
 (0)