@@ -5879,7 +5879,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
5879
5879
Parameters
5880
5880
----------
5881
5881
x : (n,) array or sequence of (n,) arrays
5882
- Input values, this takes either a single array or a sequency of
5882
+ Input values, this takes either a single array or a sequence of
5883
5883
arrays which are not required to be of the same length
5884
5884
5885
5885
bins : integer or sequence or 'auto', optional
@@ -6091,9 +6091,17 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
6091
6091
"Please only use 'density', since 'normed'"
6092
6092
"will be deprecated." )
6093
6093
6094
- # process the unit information
6095
- self ._process_unit_info (xdata = x , kwargs = kwargs )
6096
- x = self .convert_xunits (x )
6094
+ # Process unit information
6095
+ # If doing a stacked histogram, the input is a list of datasets, so
6096
+ # we need to do the unit conversion individually on eaach dataset
6097
+ if stacked :
6098
+ self ._process_unit_info (xdata = x [0 ], kwargs = kwargs )
6099
+ for i , xi in enumerate (x ):
6100
+ x [i ] = self .convert_xunits (xi )
6101
+ else :
6102
+ self ._process_unit_info (xdata = x , kwargs = kwargs )
6103
+ x = self .convert_xunits (x )
6104
+
6097
6105
if bin_range is not None :
6098
6106
bin_range = self .convert_xunits (bin_range )
6099
6107
0 commit comments