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

Skip to content

Commit 82ff081

Browse files
committed
Don't handle impossible values for align in hist()
The hist() code checks at the beginning that `align` is one of "left", "mid", or "right", so values of "edge" and "center" are impossible.
1 parent aa1e5cf commit 82ff081

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6626,7 +6626,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
66266626
width = dr * totwidth
66276627
boffset, dw = 0.0, 0.0
66286628

6629-
if align == 'mid' or align == 'edge':
6629+
if align == 'mid':
66306630
boffset += 0.5 * totwidth
66316631
elif align == 'right':
66326632
boffset += totwidth
@@ -6695,7 +6695,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
66956695
else:
66966696
minimum = 0
66976697

6698-
if align == 'left' or align == 'center':
6698+
if align == 'left':
66996699
x -= 0.5*(bins[1]-bins[0])
67006700
elif align == 'right':
67016701
x += 0.5*(bins[1]-bins[0])

0 commit comments

Comments
 (0)