Travel Tips
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
分类数据可视化 - 分布图 boxplot() / violinplot() / lvplot()
boxplot() / violinplot() / lvplot()
sns.boxplot(x="day", y="total_bill", data=tips, linewidth = 2, # 线宽 width = 0.8, # 箱之间的间隔比例 fliersize = 3, # 异常点大小 palette = 'hls', # 设置调色板 whis = 1.5, # 设置IQR notch = True, # 设置是否以中值做凹槽 order = ['Thur','Fri','Sat','Sun'], # 筛选类别 ) # 绘制箱型图 sns.swarmplot(x="day", y="total_bill", data=tips,color ='k',size = 3,alpha = 0.8) # 可以添加散点图
sns.boxplot(x="day", y="total_bill", data=tips, hue = 'smoker', palette = 'Reds') # 绘制箱型图 #sns.swarmplot(x="day", y="total_bill", data=tips,color ='k',size = 3,alpha = 0.8) # 可以添加散点图
sns.violinplot(x="day", y="total_bill", data=tips, linewidth = 2, # 线宽 width = 0.8, # 箱之间的间隔比例 palette = 'hls', # 设置调色板 order = ['Thur','Fri','Sat','Sun'], # 筛选类别 scale = 'area', # 测度小提琴图的宽度:area-面积相同,count-按照样本数量决定宽度,width-宽度一样 gridsize = 50, # 设置小提琴图边线的平滑度,越高越平滑 inner = 'box', # 设置内部显示类型 → “box”, “quartile”, “point”, “stick”, None #bw = 0.8 # 控制拟合程度,一般可以不设置 ) # 用法和boxplot类似
sns.violinplot(x="day", y="total_bill", data=tips, hue = 'smoker', palette="muted", split=True, # 设置是否拆分小提琴图 inner="quartile")
sns.violinplot(x="day", y="total_bill", data=tips, palette = 'hls', inner = None) sns.swarmplot(x="day", y="total_bill", data=tips, color="w", alpha=.5) # 插入散点图
sns.lvplot(x="day", y="total_bill", data=tips, palette="mako", #hue = 'smoker', width = 0.8, # 箱之间间隔比例 linewidth = 12, scale = 'area', # 设置框的大小 → “linear”、“exonential”、“area” k_depth = 'trustworthy', # 设置框的数量 → “proportion”、“tukey”、“trustworthy” ) # 绘制LV图 sns.swarmplot(x="day", y="total_bill", data=tips,color ='k',size = 3,alpha = 0.8) # 可以添加散点图
Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor
December 4, 2020 at 3:12 pm
Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor
December 4, 2020 at 3:12 pm
Donec in ullamcorper quam. Aenean vel nibh eu magna gravida fermentum. Praesent eget nisi pulvinar, sollicitudin eros vitae, tristique odio.
December 4, 2020 at 3:12 pm
我是 s enim interduante quis metus. Duis porta ornare nulla ut bibendum
Rosie
6 minutes ago