Python数据分析与展示(二)—Matplotlib库

Matplotlib

Python优秀的数据可视化第三方库

Matplotlib的使用

import matplotlib.pyplot as plt

Python数据分析与展示(二)—Matplotlib库_第1张图片
Python数据分析与展示(二)—Matplotlib库_第2张图片
Python数据分析与展示(二)—Matplotlib库_第3张图片

pyplot的绘图区域

plt.subplot(nrows, ncols, plot_number)

Python数据分析与展示(二)—Matplotlib库_第4张图片
Python数据分析与展示(二)—Matplotlib库_第5张图片

pyplot的plot()函数

plt.plot(x,y, format_string, **kwargs)

Python数据分析与展示(二)—Matplotlib库_第6张图片
Python数据分析与展示(二)—Matplotlib库_第7张图片

pyplot的中文显示

1、rcParams修改字体实现
Python数据分析与展示(二)—Matplotlib库_第8张图片
rcParams的属性
Python数据分析与展示(二)—Matplotlib库_第9张图片
2、增加一个属性:fontproperties
Python数据分析与展示(二)—Matplotlib库_第10张图片

pyplot的文本显示


Python数据分析与展示(二)—Matplotlib库_第11张图片
Python数据分析与展示(二)—Matplotlib库_第12张图片

pyplot的基础图标函数

Python数据分析与展示(二)—Matplotlib库_第13张图片
Python数据分析与展示(二)—Matplotlib库_第14张图片
Python数据分析与展示(二)—Matplotlib库_第15张图片

饼图的绘制—plt.pie()

Python数据分析与展示(二)—Matplotlib库_第16张图片
Python数据分析与展示(二)—Matplotlib库_第17张图片

直方图的绘制—plt.hist()

Python数据分析与展示(二)—Matplotlib库_第18张图片
Python数据分析与展示(二)—Matplotlib库_第19张图片

极坐标图的绘制

Python数据分析与展示(二)—Matplotlib库_第20张图片
Python数据分析与展示(二)—Matplotlib库_第21张图片

散点图的绘制

Python数据分析与展示(二)—Matplotlib库_第22张图片

你可能感兴趣的:(数据分析,数据分析)