Skip to content

Commit 3c8b54f

Browse files
committed
ENH: Add UserWarning when plotting bar plot with MultiIndex
1 parent 70683b8 commit 3c8b54f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/source/user_guide/visualization.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,7 @@ Asymmetrical error bars are also supported, however raw error values must be pro
14321432
Here is an example of one way to easily plot group means with standard deviations from the raw data.
14331433

14341434
.. ipython:: python
1435+
:okwarning:
14351436
14361437
# Generate the data
14371438
ix3 = pd.MultiIndex.from_arrays([

pandas/plotting/_matplotlib/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,9 @@ def __init__(self, data, **kwargs):
13571357

13581358
if isinstance(self.data.index, ABCMultiIndex):
13591359
# No real handling for MultiIndex yet
1360+
warnings.warn(
1361+
"Bar plot with a MultiIndex is not supported.", UserWarning,
1362+
)
13601363
self.ax_index = np.arange(len(data))
13611364
else:
13621365
self.ax_index = self.data.index

0 commit comments

Comments
 (0)