2017-09-26 105 views
0

image enclosd为什么我的seaborn.kdeplot是截断的

我该如何让所有数据显示?现在孩子的情节被切断

这里是我的代码:

# since it is a column and not index we need to set axis to 1 

titanic_df['Personstatus'] = 
titanic_df[['Age','Sex']].apply(male_female_child,axis=1) 
fig = sns.FacetGrid(titanic_df, hue='Personstatus', aspect=4) 
fig.map(sns.kdeplot, 'Age', shade=True) 

oldest = titanic_df['Age'].max() 

fig.set(xlim=(0, 80)) 

fig.add_legend() 
+0

我认为这是因为Seaborn根据最后的映射设置了限制。您可以自己轻松设置y限制,就像您使用xlims,'.set(ylim =(0,0.5))'一样。 – ImportanceOfBeingErnest

回答

0

最大轴限制没有被正确地更新的原因是,sns.kdeplot电话set_ylim,这turns off axes autoscaling by default。因此,这些坐标轴将被缩放到与sns.kdeplot一起绘制的第一个数据集,但是之后的所有坐标轴都保持在同一坐标轴上。

自Seaborn 0.8.1以来,这已被修复,更多信息herehere

相关问题