-
Notifications
You must be signed in to change notification settings - Fork 0
数据可视化:Matplotlib与Seaborn
Zhong Qin edited this page Aug 12, 2018
·
8 revisions
20180810
遇到数据,想要分析其分布时,应该首先考虑一下用可视化的方法进行观察。
只要是DataFrame类型的数据都可以plot
,并且对应plot
的方法有多种,选择适合观察的方法即可。
主要有四个函数:
-
df.plot.bar()
:条状 -
df.plot.line()
:线状 -
df.plot.area()
:面积 -
df.plot.hist()
:直方图
-
df.plot.scatter()
:在方法中指定x
,y
轴 -
df.plot.hex()
:在方法中指定x
,y
轴 df.plot.bar(stacked=True)
df.plot.line()
figsize
color
fontsize
title
-
ax
:与subplots
中定义的指定图表对应! ... ...
subplots
接收两个参数:行数,列数
df.plot.scatter()
df.plot.box()
sns.heatmap
pd.plotting.parallel_coordinates
使用jupyter进行可视化的时候,一定注意包含如下代码。
import matplotlib.pyplot as plt
%matplotlib inline