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.
![image](https://private-user-images.githubusercontent.com/25116183/292703040-a303ca46-c760-4aab-b809-fc8b62e6a603.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMzAxNTEsIm5iZiI6MTczOTAyOTg1MSwicGF0aCI6Ii8yNTExNjE4My8yOTI3MDMwNDAtYTMwM2NhNDYtYzc2MC00YWFiLWI4MDktZmM4YjYyZTZhNjAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDE1NTA1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIxNTQ4ZDMxNThjMjJhZWY1MWIyMzg0NzA5YWFjNjNjOTZkZDJjYjBhZGY3ZDdjZGQ1OTU3N2Q2OWE0Y2UwMTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Bq0OAkZADKZIRF0asosasO5Y65y89T_aIPQRfFyU6JE)
So how can set only the fill area as alpha=0.5? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions