seaborn stripplot有一个允许hue
的函数。
使用https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.stripplot.html中的示例
import seaborn as sns
sns.set_style("whitegrid")
tips = sns.load_dataset("tips")
ax = sns.stripplot(x=tips["total_bill"])
ax = sns.stripplot(x="sex", y="total_bill", hue="day", data=tips, jitter=True)
在这种情况下,传说是相当小的,每天都显示不同的色调。不过,我想删除这个传说。
通常,一个包含参数legend=False
。但是,对于stripplot
,这似乎会输出一个属性错误:
AttributeError: Unknown property legend
可以删除stripplots
的图例吗?如果是,怎么做?
使用
ax.legend_.remove()
如下:相关问题 更多 >
编程相关推荐