More sensible time axis and tick labels for 2D plots#5561
Merged
trexfeathers merged 6 commits intoSciTools:mainfrom Nov 3, 2023
Merged
More sensible time axis and tick labels for 2D plots#5561trexfeathers merged 6 commits intoSciTools:mainfrom
trexfeathers merged 6 commits intoSciTools:mainfrom
Conversation
Member
Author
|
Test data PR: SciTools/iris-test-data#87 |
Member
Author
|
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") |
trexfeathers
reviewed
Nov 2, 2023
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. |
trexfeathers
approved these changes
Nov 3, 2023
HGWright
added a commit
to HGWright/iris
that referenced
this pull request
Nov 17, 2023
* '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) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

🚀 Pull Request
Description
date2numconversions 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