[Python] Multiple line figure without new coloring in Altair

Discussão em 'Python' iniciado por Stack, Maio 14, 2025.

  1. Stack

    Stack Membro Participativo

    The basic example of multiple lines in Altair shows distinct lines in a different color:

    import altair as alt
    from vega_datasets import data

    source = data.stocks()

    alt.Chart(source).mark_line().encode(
    x='date:T',
    y='price:Q',
    color='symbol:N',
    )


    How does one make this same figure but using the same colour for each line and ignoring their labels (for instance when you have replicates of a model)?

    I don't want them faceted (on different panels) and I would like this scalable for 100s of different groups (such as in simulation replicates).

    Continue reading...

Compartilhe esta Página