-
Notifications
You must be signed in to change notification settings - Fork 286
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
More sensible time axis and tick labels for 2D plots #5561
Conversation
Test data PR: SciTools/iris-test-data#87 |
Note that users who specified a DateFormatter and DateLocator should not see any difference in their tick labels. E.g. this plot is the same with import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import iris
import iris.plot as iplt
import iris.tests.stock
cube = iris.tests.stock.realistic_4d()
cube = cube[:, 0, 0, :]
fig, _ = plt.subplots(layout="constrained")
iplt.contourf(cube)
ax = plt.gca()
ax.yaxis.set_major_locator(mdates.MinuteLocator(interval=10))
ax.yaxis.set_major_formatter(mdates.DateFormatter("%M minutes after %H"))
plt.savefig("test.png") |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5561 +/- ##
=======================================
Coverage 89.44% 89.44%
=======================================
Files 89 89
Lines 22597 22583 -14
Branches 5390 5386 -4
=======================================
- Hits 20211 20199 -12
+ Misses 1639 1638 -1
+ Partials 747 746 -1
☔ View full report in Codecov by Sentry. |
* 'guess_coord' of github.com:HGWright/iris: (82 commits) [pre-commit.ci] auto fixes from pre-commit.com hooks [pre-commit.ci] pre-commit autoupdate (SciTools#5579) Relicense to from LGPL-3 to BSD-3 (SciTools#5577) Allow `add_season_year()` to optionally send spans backwards (SciTools#5573) Added xarray phrasebook doc page (SciTools#5564) fixed spacing (SciTools#5572) DOCS: Removed broken git links. (SciTools#5569) More sensible time axis and tick labels for 2D plots (SciTools#5561) removed now incorrect statement. (SciTools#5555) [pre-commit.ci] pre-commit autoupdate (SciTools#5558) Exempt major release label from stalebot (SciTools#5559) updated link (SciTools#5556) Added whatsnew. (SciTools#5552) moved latest warning banner logic to conf.py (SciTools#5508) updated layout of top navbar (SciTools#5505) Oblique and Rotated Mercator (SciTools#5548) [pre-commit.ci] pre-commit autoupdate (SciTools#5549) [pre-commit.ci] pre-commit autoupdate (SciTools#5527) Bump scitools/workflows from 2023.09.1 to 2023.10.0 (SciTools#5540) nep29 drop table schedule numpy>1.21 (SciTools#5525) ...
🚀 Pull Request
Description
date2num
conversions from datetimes to floats inplot.py
. I'm not clear why these were there, but I assume were an ancient workaround for something. They had been there since the initial commit to github. Without them, the time axis ticks get labelled with datetime information instead of floats (see the updated images in the test data PR).Closes #5484 and closes #5426
Consult Iris pull request check list