[Python] Colormaps in seaborn

Discussão em 'Python' iniciado por Stack, Março 7, 2025.

  1. Stack

    Stack Membro Participativo

    I use currently the next code fragment:

    import seaborn
    import matplotlib.pyplot as plt
    plt.bar(df['Col1'], df['Col2'], width = 0.97, color=seaborn.color_palette("coolwarm", df['Col1'].shape[0], 0.999))


    Now my bars are colored in the blue-red spectre (according to the parameter coolwarm). How I can change the proportion between these 2 colors and order, for example, 80% of all bars red and only the rest of 20% in blue? (Now is 50/50 relation)

    Continue reading...

Compartilhe esta Página