绘图
柱状图
tips['total_bill'].plot.hist()
plt.show()
tips[['total_bill', 'tip']].plot.hist()
plt.show()
kde 图:
tips['tip'].plot.kde()
plt.show()
散点图:
tips.plot.scatter(x='total_bill', y='tip')
plt.show()
六角星箱体图:
tips.plot.hexbin(x='total_bill', y='tip', gridsize=10)
plt.show()
箱线图:
tips.plot.box()
plt.show()
小提琴图:
violin = sns.violinplot(x='time', y='total_bill', hue='sex', data=tips, split=True)
plt.show()
# 背景网格颜色, darkgrid, whitegrid, dark, white, ticks
sns.set_style('whitegrid')
violin = sns.violinplot(x='time', y='total_bill', hue='sex', data=tips, split=True)
plt.show()