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

How to set a multiline title for an axis or legend? #262

Closed
fredthedead opened this issue Nov 9, 2016 · 10 comments
Closed

How to set a multiline title for an axis or legend? #262

fredthedead opened this issue Nov 9, 2016 · 10 comments
Labels
vega: vega-lite Requires upstream action in `vega-lite`

Comments

@fredthedead
Copy link

Passing a string with '\n' in it doesn't seem to work

@jakevdp
Copy link
Collaborator

jakevdp commented Nov 9, 2016

I don't believe this is allowed currently in Vega-Lite.

@kanitw
Copy link
Member

kanitw commented Nov 10, 2016

Yep. This is currently not supported in Vega-Lite due to lack of support for this Vega.
But there is a feature request in Vega. vega/vega#488.

@ellisonbg
Copy link
Collaborator

Closing as vega-lite-related.

@ellisonbg ellisonbg added the vega: vega-lite Requires upstream action in `vega-lite` label Apr 19, 2017
@firasm
Copy link

firasm commented Aug 30, 2019

Sorry to comment on a closed issue, but could someone clarify how vega-lite-related issues work? I understand it needs to be implemented in Vega-lite first, but will it "automatically" work if it's implemented there or is there a delay while Altair features catch up ? It seems there isn't much hope of waiting for it to be implemented in Vega-lite...issue 488 seems pretty inactive.

This functionality is pretty essential (in my opinion) and I'm trying to figure out whether a PR to "hack this functionality" in Altair would be supported (assuming I can figure out how to do it).

@jakevdp
Copy link
Collaborator

jakevdp commented Aug 30, 2019

"vega-lite related" generally means there is no change you could make to the Altair codebase that would address the issue.

@firasm
Copy link

firasm commented Aug 30, 2019

ah okay. thanks then

@nbmorgan
Copy link

Can we reopen this? Looks like vega-lite will support this but requres passing a string array instead of a string.

@cjbraun
Copy link
Contributor

cjbraun commented Jan 31, 2020

For anyone revisiting this, Vega now supports this multiline functionality. Just pass in a list of strings as the title:

axis=alt.Axis(title=['Text on the first line', 'and text on the second line'])

@NickCrews
Copy link
Contributor

@fredthedead If you wanted to edit your original post to include this now-working solution, I'm sure people would appreciate it!

@joelostblom
Copy link
Contributor

We do currently cover this for chart subtitles in this doc page https://altair-viz.github.io/user_guide/customization.html#adjusting-the-title, but if anyone wants to add an example to that page with an axis title (or chart label for that matter) that covers two pages, then I would be happy to review a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vega: vega-lite Requires upstream action in `vega-lite`
Projects
None yet
Development

No branches or pull requests

9 participants