简体   繁体   中英

Multiple histograms on same graph with Seaborn `displot` (not `distplot`)

Seaborn distplot is deprecated.

With distplot I get the following graph

在此处输入图像描述

with this code:

import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.normal(loc=177.8, scale=10.2, size=1000), kde=True)
sns.distplot(random.normal(loc=165.1, scale=8.9, size=1000), kde=True)

plt.show()

How do I achieve the same with displot please? If I just substitute displot for distplot , the histograms are displayed separately.

Any particular reason you want to use displot? Using histplot accomplishes your goal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM