# libraries & dataset import seaborn as sns import matplotlib.pyplot as plt # set a grey background (use sns.set_theme() if seaborn version 0.11.0 or above) sns.set(style="darkgrid") df = sns.load_dataset('iris') # Just switch x and y sns.violinplot(y=df["species"], x=df["sepal_length"]) plt.show()
Once you know how to make a violinplot with seaborn, it is quite straightforward to turn it horizontal. To do so, you may just switch the order through which you declare the variables inside seaborn violinplot function.
Contact & Edit
👋 This document is a work by Yan Holtz. Any feedback is highly encouraged. You can fill an issue on Github, drop me a message onTwitter, or send an email pasting
This page is just a jupyter notebook, you can edit it here. Please help me making this website better 🙏!