It is quite straightforward to build a density plot with a 90 degrees orientation thanks to the 'vertical' parameter.
Note how in the following example, 'vertical' is set to True so that the distribution possible values are located on the y-axis, and their respective count/frequency on the x-axis.

# 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) 
df = sns.load_dataset('iris')
# setting 'vertical' parameter to True
sns.kdeplot(df['sepal_width'], shade=True, vertical=True, color="skyblue")

Contact & Edit

👋 This document is a work by Yan Holtz. You can contribute on github, send me a feedback on twitter or subscribe to the newsletter to know when new examples are published! 🔥

This page is just a jupyter notebook, you can edit it here. Please help me making this website better 🙏!