Skip to content

Commit 2feb5ef

Browse files
committed
BUG: Special case for MultiIndex bar plot
1 parent a9956db commit 2feb5ef

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
@@ -1330,7 +1330,11 @@ def __init__(self, data, **kwargs):
13301330
self.tickoffset = self.bar_width * pos
13311331
self.lim_offset = 0
13321332

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

13351339
def _args_adjust(self):
13361340
if is_list_like(self.bottom):
@@ -1359,6 +1363,8 @@ def _make_plot(self):
13591363
ax = self._get_ax(i)
13601364

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

0 commit comments

Comments
 (0)