You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: violin's default alpha no longer persists #30613
Perhaps this is an understood and accepted behaviour change, but I did not see anything in the changenotes. If we set the facecolor of a violin object after creating it, we now also override the default alpha.
Bisects to #27304. The default alpha is now included in the default facecolor as a (color, alpha) tuple, rather than being passed by the alpha parameter.
It's tricky to maintain the behavior. Previously, we had facecolor=c, alpha=0.3. We have moved the default alpha into facecolor, because the explicit parameter would overwrite any alpha in user-defined colors. So the only two options are the present change of behavior or you distinguish and set alpha=0.3 only when there are no user-defined colors.
Without context, I would be inclined to accept the breakage to keep the logic simple. But OTOH your example was the standard way to color violins before, so it is not acceptable to break that.
Activity
timhoffm commentedon Sep 29, 2025
Oh, this extra tracking of alpha is a nuissance.
It's tricky to maintain the behavior. Previously, we had
facecolor=c, alpha=0.3. We have moved the default alpha into facecolor, because the explicit parameter would overwrite any alpha in user-defined colors. So the only two options are the present change of behavior or you distinguish and setalpha=0.3only when there are no user-defined colors.Without context, I would be inclined to accept the breakage to keep the logic simple. But OTOH your example was the standard way to color violins before, so it is not acceptable to break that.
Thanks for finding out!
FIX: Keep legacy alpha behavior for violinplot without facecolor
FIX: Keep legacy alpha behavior for violinplot without facecolor
FIX: Keep legacy alpha behavior for violinplot without facecolor