@@ -6747,13 +6747,13 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6747
6747
input_empty = False
6748
6748
6749
6749
if color is None :
6750
- color = [self ._get_lines .get_next_color () for i in range (nx )]
6750
+ colors = [self ._get_lines .get_next_color () for i in range (nx )]
6751
6751
else :
6752
- color = mcolors .to_rgba_array (color )
6753
- if len (color ) != nx :
6752
+ colors = mcolors .to_rgba_array (color )
6753
+ if len (colors ) != nx :
6754
6754
raise ValueError (f"The 'color' keyword argument must have one "
6755
6755
f"color per dataset, but { nx } datasets and "
6756
- f"{ len (color )} colors were provided" )
6756
+ f"{ len (colors )} colors were provided" )
6757
6757
6758
6758
hist_kwargs = dict ()
6759
6759
@@ -6848,19 +6848,19 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6848
6848
_barfunc = self .bar
6849
6849
bottom_kwarg = 'bottom'
6850
6850
6851
- for m , c in zip (tops , color ):
6851
+ for top , color in zip (tops , colors ):
6852
6852
if bottom is None :
6853
- bottom = np .zeros (len (m ))
6853
+ bottom = np .zeros (len (top ))
6854
6854
if stacked :
6855
- height = m - bottom
6855
+ height = top - bottom
6856
6856
else :
6857
- height = m
6857
+ height = top
6858
6858
bars = _barfunc (bins [:- 1 ]+ boffset , height , width ,
6859
6859
align = 'center' , log = log ,
6860
- color = c , ** {bottom_kwarg : bottom })
6860
+ color = color , ** {bottom_kwarg : bottom })
6861
6861
patches .append (bars )
6862
6862
if stacked :
6863
- bottom = m
6863
+ bottom = top
6864
6864
boffset += dw
6865
6865
# Remove stickies from all bars but the lowest ones, as otherwise
6866
6866
# margin expansion would be unable to cross the stickies in the
@@ -6899,12 +6899,12 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6899
6899
fill = (histtype == 'stepfilled' )
6900
6900
6901
6901
xvals , yvals = [], []
6902
- for m in tops :
6902
+ for top in tops :
6903
6903
if stacked :
6904
6904
# top of the previous polygon becomes the bottom
6905
6905
y [2 * len (bins )- 1 :] = y [1 :2 * len (bins )- 1 ][::- 1 ]
6906
6906
# set the top of this polygon
6907
- y [1 :2 * len (bins )- 1 :2 ] = y [2 :2 * len (bins ):2 ] = m + bottom
6907
+ y [1 :2 * len (bins )- 1 :2 ] = y [2 :2 * len (bins ):2 ] = top + bottom
6908
6908
6909
6909
# The starting point of the polygon has not yet been
6910
6910
# updated. So far only the endpoint was adjusted. This
@@ -6924,12 +6924,12 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6924
6924
# add patches in reverse order so that when stacking,
6925
6925
# items lower in the stack are plotted on top of
6926
6926
# items higher in the stack
6927
- for x , y , c in reversed (list (zip (xvals , yvals , color ))):
6927
+ for x , y , color in reversed (list (zip (xvals , yvals , colors ))):
6928
6928
patches .append (self .fill (
6929
6929
x [:split ], y [:split ],
6930
6930
closed = True if fill else None ,
6931
- facecolor = c ,
6932
- edgecolor = None if fill else c ,
6931
+ facecolor = color ,
6932
+ edgecolor = None if fill else color ,
6933
6933
fill = fill if fill else None ,
6934
6934
zorder = None if fill else mlines .Line2D .zorder ))
6935
6935
for patch_list in patches :
0 commit comments