Does boxplot support alpha / transparency?
See original GitHub issueThe following:
sns.boxplot(data, x='foo', y='bar', alpha=0.3)
Fails with:
TypeError: boxplot() got an unexpected keyword argument 'alpha'
I presume boxplots don’t support alpha or transparency? Or is there any other way of getting it?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
boxplot_alpha: Alpha Boxplot - Microbiome Analytics - Rdrr.io
Controls the transparency of plots elements. If using boxplot and and points together how to deal with outliers. See ggplot2 outlier. fill ...
Read more >Matplotlib: how to have a transparent box plot face while a non ...
set_alpha changes both face color and edge color, to avoid that, you may want to consider passing RGBA values directly to face color:...
Read more >Overlapping boxplots with transparency - Bioconductor Forum
Hi Fong, > Hi, > > I am pretty stumped on how I can approach this problem. Basically, I have > two groups...
Read more >Control colors in a Seaborn boxplot - Python Graph Gallery
I personally think that charts look better with transparency. I find out how to do it using mwaskom's Github post. If you want...
Read more >Add transparency to objects in axes - MATLAB alpha
alpha value sets the face transparency for objects in the current axes that support transparency. Specify value as 'clear' or 'opaque' , or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It’s not supported through the seaborn API, but it is through kwargs that are passed down to matplotlib:
But this also sets the alpha on the edges of the boxes, which I find aesthetically displeasing. A more roundabout way to grab the patch artists after plotting and then to just change the alpha of the box fills:
there may be a more direct but less obvious way to do that, usually is in matplotlib.
If you’re trying to do this in 2022, change
ax.artistsforax.patches, like so: