Liubove
Liubove

Reputation: 75

How to decrease saturation of the bands in seaborn.lineplot?

I would like to keep the MEAN value in the plot the same color, and only change the saturation of the bands around the mean value, specifically make it more transparent/lighter. How to achieve that?

Here is an example plot, where I want to keep blue line blue, and the light transparent blue around the line more transparent. (similarly with the orange)

fmri = sns.load_dataset("fmri")
fmri['signal'] = np.abs(fmri['signal'].values)
ax = sns.lineplot(data=fmri, x="timepoint", y="signal", hue="event", style='event')

enter image description here

Upvotes: -1

Views: 105

Answers (1)

BigBen
BigBen

Reputation: 50143

Using the err_kws parameter and alpha. You may need to explore different values.

ax = sns.lineplot(data=fmri, x="timepoint", y="signal", 
                  hue="event", style='event',
                  err_kws={'alpha': 0.1})

Output:

enter image description here

Upvotes: 2

Related Questions