使用seaborn pairplot打印,以前使用不同的列作为色调,但在打印色调=”字母”列时,我收到用户警告,它无法打印图例?我不知道为什么
“字母”列示例
letters
_J
_A
_H
_H
_L
fig = sns.pairplot(x_vars=x, y_vars=y, data=df, hue="letters", size=5, aspect=2.65)
figlegend = self.fig.legend(handles, labels, **kwargs)
/home/ec2-user/anaconda3/envs/chainer_p36/lib/python3.6/site-packages/seaborn/axisgrid.py:98: UserWarning: The handle <matplotlib.patches.Patch object at xxxxx has a label of '_H' which cannot be automatically added to the legend.
列中所有_字母的错误相同
这是因为matplotlib开发人员选择忽略以
_
开头的标签从legend guide开始:
如果需要图例,应该创建一个新列,在该列中去掉下划线以用作
hue
相关问题 更多 >
编程相关推荐