Add test_vlines to test_datetime.py#27410
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.
e5b99f1 to
00c8072
Compare
a2252b7 to
c543e4f
Compare
| ymax=[np.datetime64('2023-05-01'), np.datetime64('2023-05-16')]) | ||
| ax3.set_xlim(left=datetime.datetime(2023, 7, 1), | ||
| right=datetime.datetime(2023, 12, 31)) | ||
| ax3.vlines(x=[datetime.datetime(2023, 9, 1), datetime.datetime(2023, 12, 10)], |
There was a problem hiding this comment.
Any reason not to re-use dates on this one?
There was a problem hiding this comment.
I wanted to make each graph look fairly different from one other, so I tried to pick different dates and x/y limits. Initially, the dates array was too long to fit on one line which is why I made it a separate variable. If you'd prefer I re-use it, I can make the change but would have to modify the x limit as well because the values in dates fall outside of the current range for ax3. Let me know what you think
There was a problem hiding this comment.
Alternatively, I could get rid of dates altogether and move the array directly into ax1.vlines() but keep each element on a different line like it is right now
There was a problem hiding this comment.
Yea, I think it'd be clearer to not have dates if it's not being reused in other places with dates.
There was a problem hiding this comment.
Got it. Just fixed it
c543e4f to
70dc609
Compare
|
Thanks @madisonwong210! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again. |
PR summary
I have added a datetime smoke test for
Axes.vlinesinlib/matplotlib/tests/test_datetime.py. It includes a combination of dates and floats for the axes as well as scalars and arrays for ymin and ymax.This addresses the
Axes.vlinestask from #26864.Here is an image of the plots:

PR checklist