海底捞的情节什么都没有

问题描述 投票:1回答:1

我想用seaborn的rugplot方法绘制一个rugplot。

import seaborn as sns
%matplotlib inline

tips = sns.load_dataset('tips')
sns.rugplot(tips['total_bill'])

但图是空的rugplot empty figure

有什么好办法吗?

python-3.x jupyter-notebook data-visualization seaborn
1个回答
1
投票

在seaborn 0.10.0中发生了一个变化 (https:/seaborn.pydata.orgwhatsnew.html。):

[...]

  • 修改了 rugplot() 以绘制 matplotlib LineCollection 而不是许多 Line2D 对象,为大型数组提供了很大的速度。

[...]

似乎新的rugplot()不能独立工作了......。(?!)

用来代替。

sns.kdeplot(tips['total_bill'], ls="")

sns.rugplot(tips['total_bill'])

首先绘制一个不可见的kdeplot,然后插入rugplot。

© www.soinside.com 2019 - 2024. All rights reserved.