Adding test for axes.streamplot using datetime #27489
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR summary
I've created a test for Axes.streamplot in test_datetime.py as requested in #26864
I tried using the normal datetime.datetime data type and passing that into np.meshgrid. However, it looks like np.meshgrid doesn't accept the datetime type and only accepts numerical arrays. I tried doing some research and looking into np.meshgrid further but could not find any way to pass in an array of datetime values. Therefore, I had to convert the datetime values into numerical values using date2num. This allows it to be passed into np.meshgrid to create the X and Y arrays which are then passed into the streamplot function.
Note: I am new to working with matplotlib and also new to open-source contributions so I would really appreciate your support and advice on this PR.
The outputted graph is as follows:

PR checklist