I am struggling to change my displot bar colours.
I want to change the colour of the bars to the light blue colour on at the end of the palette (shown below).
I have tried this, but the colour seems to remain as a dark blue, which is not what I want.
JavaScript
x
4
1
sns.color_palette("light:b", as_cmap=True)
2
sns.displot(data=df, x="col_1", height=7, aspect=2.8, palette="light:b")
3
4
How do I change the colours to a specific colour in the palette?
Advertisement
Answer
Just define your custom colour palette
.
JavaScript
1
6
1
palette = ["#090364", "#091e75", "#093885", "#085396", "#086da6",
2
"#0888b7", "#08a2c7" ]
3
4
sns.set_style("whitegrid")
5
plot = sns.displot( .,palette=sns.color_palette(palette, len(palette)), )
6