Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Axes.violinplot datetime test #27485

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

Conversation

tanvincible
Copy link

PR summary

Add complementary test for axes.violinplot in Matplotlib
This is modeled for Axes.violinplot in #26864

Image of generated plot:

Figure 2023-12-09 174127

Copy link

@github-actions github-actions bot left a 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.

@jklymak
Copy link
Member

jklymak commented Dec 9, 2023

Your commit has erased all the other tests. Suggest you copy and paste your test somewhere, do a hard rebase on upstream/main and try again.

@ksunden
Copy link
Member

ksunden commented Dec 11, 2023

Further, this shows that violinplot does not participate in the units system currently (for the main axis, I think it would be fine with doing positions in dates, which perhaps we should test regardless).

And arguably, it shouldn't?

We have a similar problem in #27038 (boxplots) because these statistical measures don't really translate well to dates.

OTOH, I think it could translate well to physical units, so perhaps we should make it so that at least we try to adhere to the units behavior...

I could make an argument for doing the unit conversion and doing the KDE/stats on the resultant floats (not sure I love that, though for most things I think it should be fine... its really nonlinear units that we'd have to worry about there...)

All that said, I am now curious if at least the positioning values (position and width) work as desired (with the latter being a timedelta). Because while doing statistics on dates can get strange fast (not impossible, just have to be careful about knowing what you are doing), saying "I want a violin plot comparing measurements taken on different dates" seems completely reasonable.

I think my leaning is to deprioritize fixing of units along the stats axis of these, but ask that this test case is written to focus on positions instead for the time being.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer a test, so cannot be merged as is (regardless of the other concerns above.)

@tanvincible tanvincible force-pushed the mtanvi19-add-violinplot-datetime-test branch from 7926923 to 60d2f95 Compare December 13, 2023 11:38
@tanvincible tanvincible deleted the mtanvi19-add-violinplot-datetime-test branch December 13, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

4 participants