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

Skip to content

Added smoke test for Axes.imshow to test_datetime.py #27476

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

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

ConstableCatnip
Copy link
Contributor

PR summary

This PR adds a smoke test for Axes.imshow in lib/matplotlib/tests/test_datetime.py and addresses task Axes.imshow in issue #26864. Due to the behavior of Axes.imshow with the mpl.rcParams["date.converter"] = "concise", I included year, month, day, and time axis scale plots.
Below is the image of the generated plot:

image

PR checklist

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.

I'm not too sure we need all 4 scales, as that is testing the concise date formatter, not anything specific to imshow.

… days, the axes labels now look like dates instead of just the year.
@ConstableCatnip
Copy link
Contributor Author

ConstableCatnip commented Dec 11, 2023

I futzed with it a bit more and found that if I removed "concise" and used a tighter date range than the axis labels looked like dates (see below). Originally at first the labels were only the year number which I thought might be confusing as it didn't look like a date. Let me know what you think!

image

@QuLogic QuLogic merged commit fa6be74 into matplotlib:main Dec 12, 2023
@QuLogic
Copy link
Member

QuLogic commented Dec 12, 2023

Thanks @ConstableCatnip! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants