Python seaborn 画图

fig = plt.figure(figsize=(16,4))

#添加子箱型图
#租车人数的箱线图
ax1 = fig.add_subplot(121)
sns.boxplot(data=BikeData, y="count")
ax1.set(ylabel="Count", title="Box Plot On Count")

# 添加第二个子图
# 租车人数和时间的箱线图
# 商业洞察:租车人数由时间是如何变化的?
ax2 = fig.add_subplot(122)
sns.boxplot(data=BikeData,y="count",x="hour")
ax2.set(xlabel="Hour", ylabel="Count", title="Box Plot On Count Across Hours")

画出count与holiday的箱线图以及count与month的箱线图

ax3 = fig.add_subplot(122)
sns.boxplot(data=BikeData,y="count",x="holiday")
ax3.set(xlabel="holiday", ylabel="Count", title="Box Plot On holiday")

ax4 = fig.add_subplot(121)
sns.boxplot(data=BikeData,y="count",x="month")
ax4.set(xlabel="month", ylabel="Count", title="Box Plot On Count Across month")

你可能感兴趣的:(Python基础,Python)