Skip to content

Commit 568365e

Browse files
committed
Add support for barcharts with x-axis date data.
1 parent c8436ef commit 568365e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plotly/matplotlylib/renderer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def draw_bar(self, coll):
256256
y = [bar['y1'] for bar in trace]
257257
bar_gap = mpltools.get_bar_gap([bar['x0'] for bar in trace],
258258
[bar['x1'] for bar in trace])
259+
if self.x_is_mpl_date:
260+
x = [bar['x0'] for bar in trace]
261+
x = mpltools.mpl_dates_to_datestrings(x)
259262
else:
260263
self.msg += " Attempting to draw a horizontal bar chart\n"
261264
old_rights = [bar_props['x1'] for bar_props in trace]

0 commit comments

Comments
 (0)