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

Add example of left aligning title with axis line via frame=group #3402

Open
joelostblom opened this issue Apr 12, 2024 · 0 comments
Open

Add example of left aligning title with axis line via frame=group #3402

joelostblom opened this issue Apr 12, 2024 · 0 comments

Comments

@joelostblom
Copy link
Contributor

joelostblom commented Apr 12, 2024

What is your suggestion?

I didn't know about frame='group' until vega/vega#3903. I have been avoiding using left aligned titles because I don't like the aesthetics of them going past the y-axis line. Now that's no longer an issue and it looks so great when it's aligned with the axis line:

import altair as alt
from vega_datasets import data


source = data.movies.url

title = alt.Title('A title for my histogram', anchor='start')
chart = alt.Chart(source, title=title, height=200).mark_bar().encode(
    alt.X("IMDB_Rating:Q", bin=True),
    y='count()',
)

title2 = alt.Title('A title for my histogram', anchor='start', frame='group')

chart | chart.properties(title=title2)

image

Have you considered any alternative solutions?

No response

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

1 participant