Replies: 3 comments 1 reply
-
Pretty sure that matplotlib does not support different alpha for the fill and edge colors ; nothing much to do here (except reaching down to matplotlib if you really need it). Also alpha is not supposed to be a parameter of violinplot which is why it does not work, though I suppose it could be added. I am not sure of the use case though as you would not expect them to be stacked. |
Beta Was this translation helpful? Give feedback.
-
Thank you! Sometimes I can need to stack violin plots in order to compare the distribution of data. Now I set the alpha of the fill manually by saving the image in svg through adobe. Fortunately, the fill and contour lines are on different layers. |
Beta Was this translation helpful? Give feedback.
-
You can pass an alpha value to sns.violinplot(data=[data], facecolor=(1, 0, 0, .2), linewidth=3) |
Beta Was this translation helpful? Give feedback.
-
Hi, I am drawing a violinplot by seaborn. I want to set the fill area as alpha=0.5 and edge(edge line) alpha=1.
However, I found that the param
alpha
andcolor
not work.When I use
sns.violinplot(data=[data], color=(1, 0, 0), alpha=0.5)
orsns.violinplot(data=[data], color=(1, 0, 0, 0.5))
, I get same figure:Then I tried folowing code:
It works, I get this figure. But the alpha of the edge(edge line) is also set as 0.5.
So how can set only the fill area as alpha=0.5? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions