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

Skip to content

Added Axes.stairs test in test_datetime.py #27424

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 9 commits into from
Dec 13, 2023

Conversation

ifEricReturnTrue
Copy link
Contributor

@ifEricReturnTrue ifEricReturnTrue commented Dec 2, 2023

PR summary

add code for Axes.stairs in test_datetime.py as requested in #26864.
image

PR checklist

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.

@oscargus
Copy link
Member

oscargus commented Dec 4, 2023

Thank you! I'd suggest using dates for more than just the x-axis (currently, the three subplots are testing the same thing). A common pattern is something like:

  • dates for x-axis
  • dates for y-axis
  • dates for both x- and y-axis

In this way, one can be a bit more certain that it works.

@ifEricReturnTrue
Copy link
Contributor Author

Hi!
I have changed my test as you requested. Please see the updated plot below. Thanks!
image

@ksunden
Copy link
Member

ksunden commented Dec 5, 2023

I think that an explicit value should be passed for baseline here. the default value is the (arbitrary) zero mark for our date system (1980-01-01), and that is creeping into these plots.

That also tests that the baseline behavior acts as we expect with unitful data.

@ifEricReturnTrue
Copy link
Contributor Author

Hi! Thank you for your reply. I tried to use baseline but I found there is no where else using this baseline value in the test_datetime file. Is it necessary to use this value in this test?

@ksunden
Copy link
Member

ksunden commented Dec 8, 2023

baseline is a parameter specifically to stairs. the bottom argument to bar and stem is the same idea (just a different name).

(stackplot also had discussion about baseline, though that spun out into #27129, because that method only supports specific values)

@ifEricReturnTrue
Copy link
Contributor Author

Thank you for the clarification! I have added the baseline component into my test in the latest commits. And you can see that the figure is now limited at 1980-1-1
image

@ksunden ksunden added this to the v3.9.0 milestone Dec 11, 2023
ifEricReturnTrue and others added 2 commits December 12, 2023 15:04
Co-authored-by: Elliott Sales de Andrade <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
@ifEricReturnTrue
Copy link
Contributor Author

Thank you for your suggestion! I have just committed your suggestions!

@QuLogic QuLogic changed the title Completed Axes.stairs in test_datetime.py Added Axes.stairs test in test_datetime.py Dec 13, 2023
@QuLogic QuLogic merged commit 1c6fb79 into matplotlib:main Dec 13, 2023
@QuLogic
Copy link
Member

QuLogic commented Dec 13, 2023

Thanks @ifEricReturnTrue! 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
Development

Successfully merging this pull request may close these issues.

4 participants