How to change spacing between facets (rows/columns) #3018
-
MWEimport altair as alt
from vega_datasets import data
source = data.barley()
chart = alt.Chart(source).mark_bar().encode(
x=alt.X('year:O', title="More than year"),
y='sum(yield):Q',
color='year:N',
column='site:N'
)
chart.show() QuestionHow can I space out the colums such that the labels no longer overlap? |
Beta Was this translation helpful? Give feedback.
Answered by
joelostblom
Apr 11, 2023
Replies: 1 comment 2 replies
-
There is a alt.Chart(source).mark_bar().encode(
x=alt.X('year:O', title="More than year"),
y='sum(yield):Q',
color='year:N',
column=alt.Column('site:N', spacing=50)
) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mcp292
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a
spacing
parameter (although it might be nicer to make these vertical bar chart, add newlines, or rotate the labels):