Let the waterfall plot thin its x labels - #238
Merged
Merged
Conversation
An inventory spanning decades gives the waterfall one bar, and one rotated label, per time step, which is unreadable well before the axis runs out of room. `xtick_interval=5` labels every fifth step and hides the rest. The `static` and `prospective` columns are not time steps, so they keep their labels whatever the interval is.
TimoDiepers
force-pushed
the
feature/waterfall-xtick-interval
branch
from
September 17, 2026 11:46
c0be993 to
56b874f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #238 +/- ##
==========================================
+ Coverage 83.75% 84.92% +1.17%
==========================================
Files 16 16
Lines 3760 3767 +7
==========================================
+ Hits 3149 3199 +50
+ Misses 611 568 -43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
An inventory spanning decades gives
plot_characterized_inventory_as_waterfallone bar — and one rotated label — per time step, which stops being readable well before the axis runs out of room. A 50-year use phase produces 51 of them.xtick_interval=5labels every fifth step and hides the rest:The default stays
None, i.e. every step labelled, so nothing changes for existing code.The
staticandprospectivecolumns are not time steps, so they are skipped by the counter and keep their labels whatever the interval is.Tests
Four cases in
tests/test_utils.pyagainst a stub carrying only what the function reads: no interval labels all twelve years,5gives 2025/2030/2035,4gives 2025/2029/2033, and a fourth assertsstaticandprospectivesurvive alongside the thinned years.Worth knowing for anyone writing similar tests: matplotlib drops invisible labels from
get_xticklabels()once the figure is drawn, so the assertions compare the visible label texts rather than counting hidden ones.