设置风格

1
plt.style.use('ggplot')

直方图

横轴为文字的样式

数据集:pandas中的DataFrame或者Series

使用plot选择类型,需要数据集提前处理好为两个量

1
2
3
4
5
df.plot(kind='bar')
df.xlabel()
df.ylabel()
df.title()
plt.show()

散点图

函数:

1
plt.scatter(x=None, y=None, c=颜色, s=点的大小)