Data Visualisation 整理总结
Plot的主要结构
#设定figure大小
plt.figure(figsize = (12,6))
#各种plot的方法
#。。。。
# (需要的话)Add label for vertical axis
plt.xlabel("Genre")
#add title
plt.title("Average Game Score, by Platform and Genre")
分类:
1. 为了显示Trends
A trend is defined as a pattern of change.
sns.lineplot :
Line charts 对显示一段时间的趋势,或者显示不同趋势的对比有优势
#set the weight and height of the figure
plt.figure(figsize=(12,6))
#set title
plt.title('Avila Adobe visitors')
# Line plot showing the number of visitors to Avila Adobe over time
sns.lineplot(data = museum_data['Avila Adobe'])
# Add label for horizontal axis
plt.xlabel("Date")
2. Distribution:(描述性质的)
为了显示出我们所期待的possible values
(1) sns.distplot ——Histograms(直方图)
显示单一的数字型变量
sns.distplot(a=iris_data