Skip to content
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

axis automargin moves axis label outside of individual tick labels, not the longest tick label #2575

Closed
yniknafs opened this issue Apr 20, 2018 · 8 comments
Labels
feature something new

Comments

@yniknafs
Copy link

see #2243

Using automargin: true moves axis label outside of tick labels, but only to the tick labels near the axis label, not below the longest tick label.

e.g.,

image

@alexcjohnson
Copy link
Collaborator

Thanks @yniknafs - can you work this plot into a codepen/jsfiddle so we can debug?

@yniknafs
Copy link
Author

Made a codepen showing the behavior.

image

@yniknafs
Copy link
Author

Honestly, I think this behavior could work if it wasn't so close to the tick labels. A short term fix may be to just add a bigger buffer? the way it is now, the label can sort of get lose in the tick labels. A few extra pixels could go a long way.

@alexcjohnson
Copy link
Collaborator

Thanks @yniknafs for the codepen 🎉

@nicolaskruchten I thought in my fiddling yesterday it looked like in cases like this we were pushing the x title down below all the tick labels... but here we are automatically adjusting the margins but the title just avoids the nearby labels... even if I shorten the really long labels.

So let me toss this back to you, is this a bug or is this how the feature was intended to work so this is a feature request?

@yniknafs totally agreed that the title/label padding would be nice as an adjustable parameter.

@nicolaskruchten
Copy link
Contributor

Let me dig into this today, this behaviour does seem at odds with the intended behaviour.

@nicolaskruchten nicolaskruchten self-assigned this Apr 20, 2018
@nicolaskruchten
Copy link
Contributor

So the current behaviour surprised me, but is actually not a bug: the automargin feature correctly pushes the margins so as to leaves enough room below the tick labels for the axis title's font height, but the axis title doesn't always position itself below the tallest tick label: it positions itself below the tallest tick label above itself which my tests hadn't shown, hence my initial surprise.

So this is not a bug but a reasonable feature request: to be able to control the positioning of the axis title with respect to the labels above it :)

@nicolaskruchten nicolaskruchten removed their assignment Apr 23, 2018
@yniknafs
Copy link
Author

@nicolaskruchten Thanks for the response. I agree - the auto margin is technically doing what it should do. In practice, I think the current functionality could result in a plots that don't look quite right. See image below. I'm kind of stuck between a rock and a hard place with this. Not sure what I can do to make it look right. May have to add my own custom annotation, which isn't pleasant for a dynamic plot that can have different labels / different numbers of bars, etc.

image

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

5 participants