📜  `distplot` 是一个已弃用的函数,将在未来的版本中删除.请调整您的代码以使用“displot”(具有类似灵活性的图形级函数)或“histplot”(直方图的轴级函数). - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:34.320000             🧑  作者: Mango

代码示例1
# change from displot to displot
# Code Sample:
feature2_ok = df.loc[df["target"] == 1]
feature2_ng = df.loc[df["target"] == 0]

fig, ax = plt.subplots(figsize=(20, 6))
sns.histplot(feature2_ok["feature_2"], color="orange", label="100% Equities", kde=True, linewidth=0)
sns.histplot(feature2_ng["feature_2"], label="100% Equities", kde=True, linewidth=0)

ax.set(xlim=(-100, 700), 
 xticks=[-100, -50, 0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700])

plt.legend(["Frist State", "Zero State"])
plt.title('Machine Performance Feature 2')
plt.ylabel('Frequency')
plt.grid()
plt.show()