Skip to content

Sparsify long-range yearly return labels with a ceiling-based step#527

Open
Whning0513 wants to merge 1 commit into
ranaroussi:mainfrom
Whning0513:fix-issue-518
Open

Sparsify long-range yearly return labels with a ceiling-based step#527
Whning0513 wants to merge 1 commit into
ranaroussi:mainfrom
Whning0513:fix-issue-518

Conversation

@Whning0513

Copy link
Copy Markdown

Fixes #518.

plot_returns_bars() tries to thin the year labels once the chart spans more than 10 years, but it was using int(len(years) / 10). For 11-19 years that still evaluates to 1, so every label is rendered and the long-range yearly plots stay crowded.

This switches the thinning step to a ceiling-based calculation and keeps the label updates on the existing bar tick positions. I also added a regression test that covers a 12-year benchmark comparison and checks that the year labels are actually sparsified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] EOY returns vs benchmark on time range longer than 10y

1 participant