Add split palette and hatching to violinplot?
See original GitHub issueHi Seaborn devs,
I modified the violinplot for more flexible palette colouring and hatching when data is split by hue. Would you be interested in adding this functionality to violinplot? If so, I’d be happy to clean it up and make a PR.
Edit: to clarify, there is currently no way to colour by x-axis category when the hue
keyword is given, and no current way to add hatching to any of the fills. The modifications are two new keywords, hatch=None
and split_palette=False
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Control the colors in seaborn violinplots - Python Graph Gallery
Using a color palette. Simply set the 'palette' parameter in the violinplot function. Doing so can add information on the groups order for...
Read more >Violin plot customization — Matplotlib 3.6.2 documentation
This example demonstrates how to fully customize violin plots. The first plot shows the default style by providing only the data. The second...
Read more >How to add hatches on seaborn violin plot? - Stack Overflow
IIUC: import seaborn as sns import matplotlib as mpl tips = sns.load_dataset("tips") hatch = ['/','\\','+','o'] ihatch = iter(hatch) ax ...
Read more >seaborn.violinplot — seaborn 0.12.1 documentation - PyData |
If point or stick , show each underlying datapoint. Using None will draw unadorned violins. splitbool, optional. When using hue nesting with a...
Read more >Exploring Data Visualisation using Matplotlib and Seaborn
The aim of Seaborn is to provide high-level commands to create a variety of plot ... sns.violinplot(data=df3,palette='rocket') plt.show().
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 FreeTop 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
Top GitHub Comments
By the way here is a method for adding hatches without hacking/extending the violinplot function itself:
This didn’t work completely for me, but instead I used: [c for c in ax.get_children() if isinstance(c, matplotlib.patches.Rectangle)][1].set_hatch(“//”)