-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lmplot/regplot can't set alpha of x_estimator #2538
Comments
Here is an attempt to a reproducible example:
Even the trick to put the transparency into the palette doesn't lead to transparent bars ( |
seaborn doesn't as a rule use the alpha channel of values in a color palette, often because alpha is getting set elsewhere. Matching the error bar alpha to the scatter point alpha seems reasonable. You can also modify the alpha value by doing something like |
I face a very similar problem with lineplots. Here's what I have: ax = sns.lineplot(
x='x', y='y', hue='source', style='source', markers=True, data=df_bits,
err_style="bars", err_kws={ 'elinewidth':2, 'capsize':5, 'capthick':2, }
) If I add 'alpha' in the
|
lmplot and regplot both allow setting transparency for either scatterplot points or fit lines, through
scatter_kws
andline_kws
, respectively. However, ifx_estimator
is set (for example tonp.mean
), then the scatterplot is replaced by confidence bars and a point at the estimated value. There is currently no way to set the transparency of these confidence bars.For example:
Creates an image like:
Since the two distributions I'm plotting stomp all over one another, I'd really like to make those estimation bars semi-transparent.
I believe the problem comes from the following lines:
seaborn/seaborn/regression.py
Lines 398 to 407 in 0f538fb
If
x_estimator
is set, then scatterplot creates a new set of keywords,c_kws
, which inherits the color from the user-specifiedkws
, but no other values like alpha.It seems reasonable to me that the confidence bars and scatterplot should share an alpha value, but if there's a compelling reason to keep those values distinct then it would be great if there were another way to specify the alpha values of those bars.
The text was updated successfully, but these errors were encountered: