赞
踩
准备工作及数据导入代码在博客seaborn库的介绍与使用里有:
https://blog.csdn.net/weixin_43799652/article/details/102484031
# 导入数据
tips = sns.load_dataset("tips")
tips.head()
sns.stripplot(x = 'day',y = 'tip'
,data = tips
)
sns.stripplot(x = 'day',y = 'tip'
,data = tips
,hue = 'sex' # 以性别分类
,palette = 'Blues' # 设置颜色调色盘
)
sns.stripplot(x = 'day',y = 'tip'
,data = tips
,hue = 'sex' # 以性别分类
,palette = 'Blues' # 设置颜色调色盘
,dodge = True # 分开显示
)
sns.swarmplot(x = 'day',y = 'tip'
,data = tips
)
sns.swarmplot(x = 'day',y = 'tip'
,data = tips
,hue = 'sex' # 以性别分类
,palette = 'icefire' # 设置颜色调色盘
)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。