-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1577,6 +1577,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 via parameter 'x'." | ||
raise ValueError(msg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small thing but |
||
|
||
p = _CategoricalPlotter( | ||
data=data, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1168,7 +1168,25 @@ | |
g = catplot(**kwargs, kind="box") | ||
|
||
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] | ||
} | ||
|
||
try: | ||
boxplot(**kwargs, positions=positions) | ||
err = None | ||
except ValueError as e: | ||
err = e | ||
|
||
assert(err is not None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be slightly more idiomatic I think to use |
||
|
||
|
||
|
||
class TestBoxenPlot(SharedAxesLevelTests, SharedPatchArtistTests): | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For a horizontal boxplot you'd specify the positions with
y
so let's make the suggestion less specific. Note that I've also tweaked the formatting.