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

Lines changed: 8 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy