AttributeError:“ PathCollection”对象没有属性“ hue”

时间:2020-10-16 07:37:11

标签: python plot seaborn

我正试图了解海洋功能。我正在尝试执行在JupyterLab 2.2.6的seaborn网站上显示的jointplot函数

https://seaborn.pydata.org/generated/seaborn.jointplot.html#seaborn.jointplot

代码如下:

import seaborn as sns
penguins = sns.load_dataset("penguins")
sns.jointplot(data=penguins, x="bill_length_mm", y="bill_depth_mm", hue="species")

尝试此操作,我在屏幕上得到一个空白图,并显示一条错误消息:

AttributeError: 'PathCollection' object has no property 'hue'

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

只需更新终端机中的季节性的$ sudo pip install seaborn -U

要检查您的版本,请运行以下python命令:

import seaborn as sns
sns.__version__