Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions seaborn/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,10 @@ def boxplot(
fliersize=None, hue_norm=None, native_scale=False, log_scale=None, formatter=None,
legend="auto", ax=None, **kwargs
):
if "positions" in kwargs:
msg = "boxplot() does not support parameter 'positions'. Consider to use " \
"native_scale=True and specify positions explicitly."
raise RuntimeError(msg)

p = _CategoricalPlotter(
data=data,
Expand Down
11 changes: 11 additions & 0 deletions tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,17 @@ def test_vs_catplot(self, long_df, wide_df, null_df, flat_series, kwargs):

assert_plots_equal(ax, g.ax)

@pytest.mark.parametrize("positions", [None, [1, 2, 3, 4]])
def test_reject_boxpositions(self, positions):
kwargs = {
"x": [1, 2, 3, 4],
"y": [1, 1, 2, 2]
}
with pytest.raises(RuntimeError, match="boxplot\\(\\) does not support "
"parameter 'positions'\\. Consider to use "
"native_scale=True and specify positions explicitly."):
boxplot(**kwargs, positions=positions)


class TestBoxenPlot(SharedAxesLevelTests, SharedPatchArtistTests):

Expand Down