@@ -5892,7 +5892,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
58925892 Parameters
58935893 ----------
58945894 x : (n,) array or sequence of (n,) arrays
5895- Input values, this takes either a single array or a sequency of
5895+ Input values, this takes either a single array or a sequence of
58965896 arrays which are not required to be of the same length
58975897
58985898 bins : integer or sequence or 'auto', optional
@@ -6104,30 +6104,31 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61046104 "Please only use 'density', since 'normed'"
61056105 "will be deprecated." )
61066106
6107- # process the unit information
6108- self ._process_unit_info (xdata = x , kwargs = kwargs )
6109- x = self .convert_xunits (x )
6110- if bin_range is not None :
6111- bin_range = self .convert_xunits (bin_range )
6112-
6113- # Check whether bins or range are given explicitly.
6114- binsgiven = (cbook .iterable (bins ) or bin_range is not None )
6115-
61166107 # basic input validation
61176108 input_empty = np .size (x ) == 0
6118-
61196109 # Massage 'x' for processing.
61206110 if input_empty :
6121- x = np .array ([[]])
6111+ x = [ np .array ([])]
61226112 else :
61236113 x = cbook ._reshape_2D (x , 'x' )
61246114 nx = len (x ) # number of datasets
61256115
6116+ # Process unit information
6117+ # Unit conversion is done individually on each dataset
6118+ self ._process_unit_info (xdata = x [0 ], kwargs = kwargs )
6119+ x = [self .convert_xunits (xi ) for xi in x ]
6120+
6121+ if bin_range is not None :
6122+ bin_range = self .convert_xunits (bin_range )
6123+
6124+ # Check whether bins or range are given explicitly.
6125+ binsgiven = (cbook .iterable (bins ) or bin_range is not None )
6126+
61266127 # We need to do to 'weights' what was done to 'x'
61276128 if weights is not None :
61286129 w = cbook ._reshape_2D (weights , 'weights' )
61296130 else :
6130- w = [None ]* nx
6131+ w = [None ] * nx
61316132
61326133 if len (w ) != nx :
61336134 raise ValueError ('weights should have the same shape as x' )
0 commit comments