-
Notifications
You must be signed in to change notification settings - Fork 766
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
Color and Shape Legends Not Combined in Line Chart or Multiple Charts #1785
Comments
I think the behavior of the first chart is expected, because lines don't have a shape, and therefore the line legend is separate from the shape legend. The second example is unexpected to me. You can work around it by making the legend scales independent: alt.layer(
points, lines
).resolve_scale(
color='independent',
shape='independent'
) But I would not expect this to be necessary when the line legend is set to None. It may be worth reporting this as a bug or feature request within the Vega-Lite repository. |
These are probably questions to raise in the Vega-Lite forums. One note: the last chart will work as expected if you use a alt.Chart(source).mark_line().encode(
x='x:Q',
y='values:Q',
color='operation:N',
shape='shifted:N',
detail='shifted:N'
) |
For reference, the corresponding Vega-Lite issue is here vega/vega-lite#5996 |
Closing as this is tracked in the VL issue linked above and there is nothing that can be done from the altair side of things to fix it. |
Code to reproduce:
In line chart:
Multi Charts:
Expected behaviour
The legend should be like this:
The text was updated successfully, but these errors were encountered: