通过Python绘制密度图

2024-06-13 21:24:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过Python绘制密度图。 到目前为止,我正在使用以下代码:

for s in data_Pre1.columns:
    data_Pre1[s].plot(kind='kde', normed = True)
plt.title("Disk Galaxies", fontsize = 18)
plt.xlabel("$E_i$", fontsize = 18)
plt.ylabel('Number of images', fontsize = 18)
plt.xlim(-1,1)
plt.ylim(0.1,1.0)
plt.legend(fontsize =18)
plt.show()

我的数据集中有两列。我从0-4得到y-lims。但为了显示百分比,大多数密度图都有0.1到1.0点的限制。我不知道为什么我得到0-4,我可以解释它

提前感谢Density plots of two variables simultaneously


Tags: columns代码intruefordataplot绘制