Plot CDF + cumulative histogram using Seaborn Python
import numpy as np
import seaborn as sns
x = np.random.randn(200)
stat = "count" # or proportion
sns.histplot(x, stat=stat, cumulative=True, alpha=.4)
sns.ecdfplot(x, stat=stat)
You can get almost the same plot using matplotlib by using cumulative=True
and density=True
.
plt.hist(x,cumulative=True, density=True, bins=30)