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

Skip to content

Commit 60264b2

Browse files
committed
FIX: brokenbarh math before units
1 parent d797669 commit 60264b2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,11 +2525,12 @@ def broken_barh(self, xranges, yrange, **kwargs):
25252525
self._process_unit_info(xdata=xdata,
25262526
ydata=ydata,
25272527
kwargs=kwargs)
2528-
for nn, xr in xranges:
2528+
xnew = []
2529+
for xr in xranges:
25292530
# convert the absolute values, not the x and dx...
2530-
xranges[nn] = [self.convert_xunits(xr[0]),
2531-
self.convert_xunits(xr[0]+xr[1])]
2532-
xranges[nn][1] = xranges[nn][1] - xranges[nn][0]
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]
25332534

25342535
yrange = self.convert_yunits(yrange)
25352536

0 commit comments

Comments
 (0)