Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejecting parameter 'positions' for boxplot(), refs #3566 #3576

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
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