-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added test for ax.violin #27486
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
base: main
Are you sure you want to change the base?
Added test for ax.violin #27486
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
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.
Please do not run an autoformatter on the entire file. this makes it very hard for us to actually see what the changes proposed here are. Please revert all unrelated changes here. (as much as I personally like black
style, this project does not use it and we don't like changing large amounts of code for purely stylistic reasons)
This test does not use datetime
s, as is the explicit goal of the tests in this file, as such it is not testing what we are setting out to test.
However, I actually think I may err towards just deleting this test, for the reasons laid out in #27485 (comment) (plus the fact that the things I do still want to test are equally tested by testing violinplot
)
@@ -755,8 +793,32 @@ def test_triplot(self): | |||
@pytest.mark.xfail(reason="Test for violin not written yet") | |||
@mpl.style.context("default") | |||
def test_violin(self): | |||
fig, ax = plt.subplots() | |||
ax.violin(...) | |||
plt, ax = plt.subplots(1, 1) |
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.
plt, ax = plt.subplots(1, 1) | |
fig, ax = plt.subplots(1, 1) |
This is flagging flake8
because it is reusing the name for pyplot
, the idiomatic name for this variable is fig
, as it is a Figure
object.
PR summary
Added tests for ax.violin in test_datetime.py, 2 example cases are provided.
Parent issue to expand test coverage see issue #26864
added two randomly generated distribution and plot them with ax.violin()