Thanks to visit codestin.com
Credit goes to github.com

Skip to content

broken_barh does not properly support units #4906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down