diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 01c94be87190..c2b8dc60fae3 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2275,6 +2275,13 @@ def broken_barh(self, xranges, yrange, **kwargs): .. plot:: mpl_examples/pylab_examples/broken_barh.py """ + # process the unit information + self._process_unit_info(xdata=xranges[0], + ydata=yrange[0], + kwargs=kwargs) + xranges = self.convert_xunits(xranges) + yrange = self.convert_yunits(yrange) + col = mcoll.BrokenBarHCollection(xranges, yrange, **kwargs) self.add_collection(col, autolim=True) self.autoscale_view() @@ -5785,6 +5792,12 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, if histtype == 'barstacked' and not stacked: stacked = True + # process the unit information + self._process_unit_info(xdata=x, kwargs=kwargs) + x = self.convert_xunits(x) + if bin_range is not None: + bin_range = self.convert_xunits(bin_range) + # Check whether bins or range are given explicitly. binsgiven = (cbook.iterable(bins) or bin_range is not None)