pandas Dataframe.hist直方图,seaborn风格

时间:2017-02-13 15:36:35

标签: python pandas histogram seaborn

我有一个数据帧,即

df = pd.DataFrame([1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10])

使用hist()产生例如:

df.hist()

enter image description here

这是准确的,但在视觉上并不令人愉快,尽管可以改进,例如

df.hist(ec='black')

enter image description here

默认情况下seaborn提供的内容很远(编辑:Seaborn似乎进行插值并给出描述直方图分布的直线)。另一方面,seaborn默认不会给我"权利" (=我想要/期望;))没有箱子和y轴,例如:

import seaborn as sns
sns.distplot(df.values);
plt.show()

enter image description here

有没有办法让panda的hist命令在熊猫中重现seaborn的风格?

0 个答案:

没有答案