This plot has dates across the top of the columns. They flow over each other making them difficult to read. Is there a way to rotate these vertically? I could not find the solution online.
rr_st = alt.Chart(dfag).mark_bar().encode(
x=alt.X('rebalance_range:O', title=""),
y=alt.Y('mean(annual_return):Q', title='annual return'),
column= alt.Column('start_date', title=""),
color=alt.Color('rebalance_range:O', title='rebalance range')
)
rr_st
Change Text Direction Using A Text Box Select the text orientation you need and select okay. b) left click inside the text box, then right click, and select “Borders and Alignment” from the options that appear. Select the text orientation you need and select okay.
We can remove the grid lines on x or y-axis by specifying the argument grid=False inside alt. X() or alt. Y() method in the encoding channels.
These are the labels for the column header; as such you can use Header(labelAngle)
within the column
encoding:
alt.Chart(dfag).mark_bar().encode(
x=alt.X('rebalance_range:O', title=""),
y=alt.Y('mean(annual_return):Q', title='annual return'),
column= alt.Column('start_date',
title="",
header=alt.Header(labelAngle=90)
),
color=alt.Color('rebalance_range:O', title='rebalance range')
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With