Skip to content

Commit 01f85af

Browse files
committed
FIX: brokenbarh math before units
1 parent 6d91ed9 commit 01f85af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/matplotlib/axes/_axes.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2525,10 +2525,16 @@ def broken_barh(self, xranges, yrange, **kwargs):
25252525
self._process_unit_info(xdata=xdata,
25262526
ydata=ydata,
25272527
kwargs=kwargs)
2528-
xranges = self.convert_xunits(xranges)
2528+
xnew = []
2529+
for xr in xranges:
2530+
# convert the absolute values, not the x and dx...
2531+
xnew.append([self.convert_xunits(xr[0]),
2532+
self.convert_xunits(xr[0]+xr[1])])
2533+
xnew[-1][1] = xnew[-1][1] - xnew[-1][0]
2534+
25292535
yrange = self.convert_yunits(yrange)
25302536

2531-
col = mcoll.BrokenBarHCollection(xranges, yrange, **kwargs)
2537+
col = mcoll.BrokenBarHCollection(xnew, yrange, **kwargs)
25322538
self.add_collection(col, autolim=True)
25332539
self.autoscale_view()
25342540

0 commit comments

Comments
 (0)