Skip to content

Commit 7158969

Browse files
committed
ENH: Add UserWarning when plotting bar plot with MultiIndex
1 parent 64c79c6 commit 7158969

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/source/user_guide/visualization.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ Asymmetrical error bars are also supported, however raw error values must be pro
14031403
Here is an example of one way to easily plot group means with standard deviations from the raw data.
14041404

14051405
.. ipython:: python
1406+
:okwarning:
14061407
14071408
# Generate the data
14081409
ix3 = pd.MultiIndex.from_arrays([

pandas/plotting/_matplotlib/core.py

+3
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,9 @@ def __init__(self, data, **kwargs):
13321332

13331333
if isinstance(self.data.index, ABCMultiIndex):
13341334
# No real handling for MultiIndex yet
1335+
warnings.warn(
1336+
"Bar plot with a MultiIndex is not supported.", UserWarning,
1337+
)
13351338
self.ax_index = np.arange(len(data))
13361339
else:
13371340
self.ax_index = self.data.index

0 commit comments

Comments
 (0)