How to build a basic density chart with Python
and Seaborn
.
# 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')
# Make default density plot
sns.kdeplot(df['sepal_width'])
plt.show()