Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Added conversion from datetime to float for position and width parameters in violin plots#30508
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
rcomer commentedSep 6, 2025
Hi@hasanrashid thank you for your work on this. I found that your example (and the example from#30417 (comment)) do actually work correctly with the |
…ters in violinplotResolve merge conflict
hasanrashid commentedSep 11, 2025
Sorry, I think I messed up the last commit. Cleaning it up |
PR summary
This PR intends to close [ENH]: Support using datetimes as positions argument to violin(...)#30417
It should be possible to set the position of a violin plot to be a datetime. Currently, an attempt to do this results in this error message:
TypeError: unsupported operand type(s) for +: 'float' and 'datetime.datetime'The error stems from trying to perform operations between float and datetime if datetime was provided as position arguments.
The proposed solution:
The violinplot tests in test_axes.py were successful
An example that tests both "width" and "positions":
Example:
PR checklist
positionsargument to violin(...) #30417" is in the body of the PR description tolink the related issue