-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Alignment of horizontal grid lines and tick text is off #1434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I suspect that off-center offset is on purpose. Though it would be nice to add an axis attribute (e.g. |
I don't think it's on purpose; I know that for log axes we fiddle with the positioning of individual labels (particularly to keep the small 9 from interfering with the bigger 10^n) but I suspect for linear it's just us making a poor approximation to avoid having to calculate bounding boxes individually for each tick label. I'd be happy to consider this a bug. That said there are use cases for offsetting the labels - but perhaps this would be best handled as an anchor (top/middle/bottom, or left/center/right for x axes) rather than a pixel offset? |
Closed by #1854 |
@FinnFrotscher this issue was about alignment of tick labels with their own gridlines - which to my eye looks good in the image you posted... perhaps you're concerned about the ranges of your two y axes being mismatched? Like #1962 perhaps? Can you clarify what you're interested in? |
@FinnFrotscher see #1775 (comment) for explanations. |
That's a separate issue. You have two autoranged axes, one with bars (so it doesn't pad the axis past zero unless you have negative bars) and one with a line (so it always pads the axis vertically). If you want the right-side axis to behave like the left, you can do something like |
thank you, my issue is resolved. sorry for posting it in the wrong issue. |
Visually, the tick text and the horizontal gridlines are not vertically centered, which makes the axis look slightly-off. This is already noticeable in the line chart demos:

If you zoom in on this image, you can see it more clearly:
What I would expect is vertical alignment of the tick text (regardless of font-size) with the grid lines. In the above example, the ticks would need to be moved 2px up to get the following alignment (left: new position, right: overlayed on current position):
The text was updated successfully, but these errors were encountered: