[Python] Seaborn multi line plot with only one line colored

Discussão em 'Python' iniciado por Stack, Julho 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to plot a multi line plot using sns but only keeping the US line in red while the other countries are in grey

    This is what I have so far:

    df = px.data.gapminder()
    sns.lineplot(x = 'year', y = 'pop', data = df, hue = 'country', color = 'grey', dashes = False, legend = False)


    But this does not change the lines to grey. I was thinking that after this, I could add in US line by itself in red.....

    Continue reading...

Compartilhe esta Página