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

Skip to content

Commit b49c84c

Browse files
committed
Change check for is_bar. Now just compare to BarContainer objects.
This also removes `is_barh`. Handling of orientation is postponed to the actual drawing of the bar traces.
1 parent 339b725 commit b49c84c

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

plotly/matplotlylib/mpltools.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -318,24 +318,14 @@ def get_spine_visible(ax, spine_key):
318318
return False # oh man, and i thought we exhausted the options...
319319

320320

321-
def is_bar(**props):
321+
def is_bar(bar_containers, **props):
322322
"""A test to decide whether a path is a bar from a vertical bar chart."""
323-
tests = []
324-
tests += get_rect_ymin(props['data']) == 0,
325-
if all(tests):
326-
return True
327-
else:
328-
return False
329-
330323

331-
def is_barh(**props):
332-
"""A test to decide whether a path is a bar from a horizontal bar chart."""
333-
tests = []
334-
tests += get_rect_xmin(props['data']) == 0,
335-
if all(tests):
336-
return True
337-
else:
338-
return False
324+
# is this patch in a bar container?
325+
for container in bar_containers:
326+
if props['mplobj'] in container:
327+
return True
328+
return False
339329

340330

341331
def make_bar(**props):
@@ -351,7 +341,6 @@ def make_bar(**props):
351341
"""
352342
return {
353343
'bar': props['mplobj'],
354-
'orientation': props['orientation'],
355344
'x0': get_rect_xmin(props['data']),
356345
'y0': get_rect_ymin(props['data']),
357346
'x1': get_rect_xmax(props['data']),

0 commit comments

Comments
 (0)