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.
This PR aims to fix #3583.
Briefly, it reimplements #3591 and ensures major breaks are not censored before they arrive at the minor breaks calculation. This allows minor break functions to use out-of-bounds breaks to extrapolate towards the limits.
Major breaks are now censored at two other other locations:
At first glance, it may seem redudant to censor both in the view scales and in the guides. For axis guides, that is certainly the case. However, non-position guides do not receive view scales, but the original scales, so these would need censoring.
Originally, I thought that this would be much more invasive, but it turns out we need just these two places to apply censoring.
To demonstrate, we can define a function that uses the major breaks in minor break calculations. Notice that the minor gridlines go outside the 20-40 breaks interval, because the original break calculation includes 10 and 50.
There are some caveats of course. In the plot below, the x-axis does not have a 10^-3 break, so the gridlines leading up to 10^-2 are missing. Also for a log axis, it doesn't do a great job when breaks are missing. This is illustrated below for x = 10^0, but it may also happen that the default log breaks go by steps of 100x instead of 10x when the range is large.
Created on 2023-12-07 with reprex v2.0.2