Fix #7875: last period label sometimes not drawn when using negative ticklabelindex - #7937
Draft
my-tien wants to merge 15 commits into
Draft
Fix #7875: last period label sometimes not drawn when using negative ticklabelindex#7937my-tien wants to merge 15 commits into
my-tien wants to merge 15 commits into
Conversation
Previously, the ticklabelindex property itself was used in boolean tests which can be confusing.
…tible with minor ticks. E.g. if major ticks are daily and minor ticks are hourly, tick labels on minor ticks should include hourly information.
…eriod labels The longer period labels need more space.
by adding an additional major tick at the end of the axis range + all minor ticks between the last visible tick and that helper. Previously, there was already code that added one major tick and one minor tick before tick0. Now the behavior is symmetrical to the axis range end (1 major tick and all minor ticks between that and tick0). We need all minor ticks between the first/last visible tick and the major helper tick so that walking ticklabelindex steps from that helper tick lands on the correct minor tick.
This is just to be consistent with the way major ticks are set. In axes_test we test for empty string, instead of for undefined.
…axes_period2_ticklabelindex
…of last period)
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.
The period label placement logic always requires two enclosing ticks. Because in the past (before ticklabelindex), period labels only appeared to the right of a tick, plotly added an invisible helper tick before the first visible major tick, so that the period before the first visible tick could be labeled.
With a negative ticklabelindex it's also possible to label the period left of a tick. For that case, in order to label the period after the last visible tick we need a corresponding helper tick after that.
In addition, we need all minor ticks between the first/last visible tick and the major helper tick so that walking ticklabelindex steps from that helper tick lands on the correct minor tick.