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

fittext of axis labels #14

Open
akarlinsky opened this issue Sep 26, 2019 · 2 comments
Open

fittext of axis labels #14

akarlinsky opened this issue Sep 26, 2019 · 2 comments

Comments

@akarlinsky
Copy link

Sometimes axis labels (for categorical axis) are too long and the text should flow, just like the reflow option of ggfittext. Could ggfittext be expanded to use on axis labels as well, or is this outside the scope?

@teunbrand
Copy link
Contributor

I landed here after seeing this question on SO to see if this has been suggested yet.

To make a few superficial suggestions, I think it might in theory be possible to write element_text() subclass for fitted text along with a custom element_grob() method. See for example ggtext's element_markdown() implementation. You might have the element_grob() method output a fittexttree gTree, which would then be rendered with the already existing makeContent method. Of course, this is all easier to suggest than to implement!

@wilkox
Copy link
Owner

wilkox commented Jan 30, 2021

This is certainly something I'll consider for the next major feature.

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

No branches or pull requests

3 participants