@@ -6592,18 +6592,23 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6592
6592
x = cbook ._reshape_2D (x , 'x' )
6593
6593
nx = len (x ) # number of datasets
6594
6594
6595
- # Process unit information
6596
- # Unit conversion is done individually on each dataset
6597
- self ._process_unit_info (
6598
- {"x" if orientation == "vertical" else "y" : x [0 ]}, kwargs ,
6599
- convert = False )
6600
- x = [self .convert_xunits (xi ) for xi in x ]
6595
+ # Process unit information. _process_unit_info sets the unit and
6596
+ # converts the first dataset; then we convert each following dataset
6597
+ # one at a time.
6598
+ if orientation == "vertical" :
6599
+ convert_units = self .convert_yunits
6600
+ x = [* self ._process_unit_info ({"x" : x [0 ]}, kwargs ),
6601
+ * map (convert_units , x [1 :])]
6602
+ else : # horizontal
6603
+ convert_units = self .convert_yunits
6604
+ x = [* self ._process_unit_info ({"y" : x [0 ]}, kwargs ),
6605
+ * map (convert_units , x [1 :])]
6601
6606
6602
6607
if bin_range is not None :
6603
- bin_range = self . convert_xunits (bin_range )
6608
+ bin_range = convert_units (bin_range )
6604
6609
6605
6610
if not cbook .is_scalar_or_string (bins ):
6606
- bins = self . convert_xunits (bins )
6611
+ bins = convert_units (bins )
6607
6612
6608
6613
# We need to do to 'weights' what was done to 'x'
6609
6614
if weights is not None :
0 commit comments