# 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 page is just a jupyter notebook, you can edit it here. Please help me making this website better 🙏!