本篇介绍增强箱型图、小提琴图和二维统计直方图绘制方法。其中增强箱型图和小提琴图用到了seaborn库,二维统计直方图用到了matplotlib库。
5 增强箱型图
增强箱型图是从箱型图基础上发展而来。...基础语法:
seaborn.boxenplot(x,y,hue,data,order,hue_order,orient,ax,**kwargs)
x:x轴的数值列名(本实例中为season)
y:y轴的数值列名...,X-Y轴数据为数值型。...基本语法(根据笔者的实际经验列举):
plt.hist2d(x,y,bins,cmap,norm,**kwargs)
plt.hexbin(x,y,bins,cmap,**kwargs)
x:x轴坐标数值...highlight=hist2d#matplotlib.axes.Axes.hist2d
现有一组数据(df),记录了2015年pm2.5浓度(共98万条数据),用二维统计直方图表示,代码如下:
from