Reputation: 261
I want to know how to make a plot like this (a plot having multiple y-axes), but in altair:
Upvotes: 2
Views: 1173
Reputation: 261
Start with a layered plot:
base = alt.Chart(df).encode(
x='time'
)
line = base.mark_line().encode(
y='exp'
)
circle = base.mark_circle().encode(
y='sin'
)
Then when you 'call' the chart with (line + circle)
, you add .resolve_scale(y='independent')
(line + circle).resolve_scale(
y = 'independent'
)
Upvotes: 4