-
-
Notifications
You must be signed in to change notification settings - Fork 225
Time Labels in "Plotting satellite altitude during re-entry" do not match #493
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
Comments
Thanks for letting me know! I should have time to investigate maybe by late next week, and I'll post any updates here as I look for the root problem. |
Oddly enough the plot here has the correct dates! https://rhodesmill.org/skyfield/earth-satellites.html#detecting-propagation-errors So we'll need to look into the difference between how its x axis is plotted versus the plot you've noted has problems: https://rhodesmill.org/skyfield/example-plots.html#plotting-satellite-altitude-during-re-entry |
The example gets it right by accident. Look at your year, it's 3894 or something like that. |
I have returned from travel and taken a look — the difference is in matplotlib! It changed internally how it represents dates with numbers. In 3.1.1, they were measured from the year 1: https://matplotlib.org/3.1.1/api/dates_api.html#matplotlib.dates.date2num But now are measured by default from 1970: https://matplotlib.org/3.3.1/api/dates_api.html#matplotlib.dates.date2num So exactly as you advise, I'll switch to Python datetimes. They would be inefficient for huge amounts of data (since they need an object-per-datapoint), but hopefully folks don't use this example script as their basis if they need big volumes of data. |
And that almost worked. |
A further Pandas upgrade got things working. Thanks again for pointing out the effect of matplotlib's breaking change; this will now be a stronger example for users to work from! |
In the example plot, the labeling of the time axis is wrong. The 11th of Nov 2013 is not a Thursday. The year is set wrongly, too.
Matplotlib is not converting the time from .toordinal() correctly. When changing it to .utc_datetime() the times are correct.
The text was updated successfully, but these errors were encountered: