Added datetime smoke test for Axes.hexbin#27475
Added datetime smoke test for Axes.hexbin#27475bikegeek wants to merge 7 commits intomatplotlib:mainfrom
Conversation
There was a problem hiding this comment.
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.
| ax1.hexbin(dates, y, gridsize=10) | ||
| ax2.hexbin(dates, y, gridsize=10) |
There was a problem hiding this comment.
| ax1.hexbin(dates, y, gridsize=10) | |
| ax2.hexbin(dates, y, gridsize=10) | |
| ax1.hexbin(y, dates, gridsize=10) | |
| ax2.hexbin(dates, dates, gridsize=10) |
There was a problem hiding this comment.
Didn't commit the most recent changes. Now there are tweaks to the appearance of the plots and the appropriate hexbin arguments
There was a problem hiding this comment.
Added the .rcParams["date.converter"] = 'concise' to clean up the datetime labels and updated the image in the body of the PR request.
… added mpl.rcParams to clean up axes labelling.
|
removed the mpl.rcParams from the test_tripcolor |
|
apologies, the commit didn't work, now the appropriate changes are appearing. |
|
We should probably also test with the |
|
added extents and set marginals in test_hexbin. Modified the gridsizes and updated the plot image in the body of the PR. |
ksunden
left a comment
There was a problem hiding this comment.
I think overall it is a good test, just want the extents specified as datetimes because that tests additional features that should behave as unitful data.
| extent=[19030, 19680, min(y), max(y)]) | ||
| ax1.hexbin(x, dates, marginals=True, gridsize=(10, 6), | ||
| extent=[min(x), max(x), 19030, 19680]) | ||
| ax2.hexbin(dates, dates, marginals=True, gridsize=(10, 6), | ||
| extent=[19030, 19900, 19030, 19680]) |
There was a problem hiding this comment.
The extents for a date axis should probably be given in as a datetime (and if that doesn't work, we should probably know that)
These numbers are the internal representation of matplotlib dates (days since mpl.dates.get_epoch(), which defaults to 1970-01-01) but you should be able to set them to use datetimes instead.
PR summary
This is part of the task to include additional smoke-tests for Axes. as outlined in issue #26864
A simple datetime test added for Axes.hexbin (Issue #26864) as sub-task, using only numpy datetimes and adhering to the use of the random seed 19680801. Three plots generated, one with datetime as x-axis, another with datetime as y-axis, and datetime for both x- and y-axis.
Plots look like the following:

PR checklist