SuperDARN / pydarn

Python library for visualizing SuperDARN Data
GNU Lesser General Public License v3.0
31 stars 11 forks source link

DEP: Matplotlib plot_date deprecation #394

Closed carleyjmartin closed 1 month ago

carleyjmartin commented 1 month ago

Scope

This PR replaces the plot_date function in time series plots with the recommended plot function as plot_date is just a wrapper with a formatting input for dates. We don't use timezones so there should be no issues there.

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot_date.html

issue: to close #393

Approval

Number of approvals: 1

Test

matplotlib version: 3.7.0 - 3.9.1 Note testers: please indicate what version of matplotlib you are using Testers please test with a few matplotlib versions. You can plot any time_series or summary plots to check - you should see no difference between develop and this branch except there is no deprecation notice for matplotlib 3.9+.

a = pydarn.RTP.plot_time_series(fitacf_data, beam_num=5)
plt.show()
a = pydarn.RTP.plot_summary(fitacf_data, beam_num=5)
plt.show()
Doreban commented 1 month ago

Tested this PR on windows 10 using python 3.9.2.

I tested this branch and the develop branch making summary plots and time series with the following matplotlib versions: 3.7.0, 3.8.3, 3.9.1. The time series are all identical across each matplotlib version for both this branch and develop.

The new branch did not produce any deprecation errors when plotting the summary plots with matplotlib version 3.9.1. The summary plots looked identical for each matplotlib version on the develop branch and this branch.

Here is the summary plot made using this branch: summary_plot_dep_removed_mat391

Here is the summary plot made using the develop branch: summary_plot_dep_present_mat391