Skip to content

Commit 4bfee75

Browse files
committed
BUG: Special case for MultiIndex bar plot
1 parent 66dff6b commit 4bfee75

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,11 @@ def __init__(self, data, **kwargs):
13311331
self.tickoffset = self.bar_width * pos
13321332
self.lim_offset = 0
13331333

1334-
self.ax_index = self.data.index
1334+
if isinstance(self.data.index, ABCMultiIndex):
1335+
# No real handling for MultiIndex yet
1336+
self.ax_index = np.arange(len(data))
1337+
else:
1338+
self.ax_index = self.data.index
13351339

13361340
def _args_adjust(self):
13371341
if is_list_like(self.bottom):
@@ -1360,6 +1364,8 @@ def _make_plot(self):
13601364
ax = self._get_ax(i)
13611365

13621366
if self.orientation == "vertical":
1367+
# import pdb
1368+
# pdb.set_trace()
13631369
ax.xaxis.update_units(self.ax_index)
13641370
self.tick_pos = ax.convert_xunits(self.ax_index)
13651371
self.ax_pos = self.tick_pos - self.tickoffset

0 commit comments

Comments
 (0)