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 idea is to display the grid lines in a
GridItem
and not extend theAxisItem
s ticks.This PR attempts to fix #1606, which reports that tick labels never seem to be displayed just right, when the grid is enabled.
Although the current PR seems to accomplish this, I am not quite happy with the current implementation:
AxisItem
calculates tick positions inside aGridItem
. Therefore I just added theAxisItem
objects to theGridItem
and get the positions by calling the appropriate methods. Not nice but it works.GridItem
has been improved so that it gets the right tick positions from the correspondingAxisItem
s. However, it needs to be clarified if this approach shall be adopted altogether byAxisItem
, without the need for users to manually create aGridItem
.Therefore, I marked it as draft. I am happy to receive/discuss ideas how the current approach can be improved.
Recently, #2385 was introduced that circumvents this problem, by hiding tick labels, when overlap even slightly the axis boundaries. Thus, the changes of this PR are only relevant if the style option 'hideOverlappingLabels' of all
AxisItem
s are set toFalse
.I think it is useful, to have the possibility, to show tick labels at the plotted range start and/or end, when the tick label positions exactly match the start and/or end coordinate. Afaik matplotlib also does this.
Example to compare the behavior before and after