pyplot基础图表函数概述
matplotlib可以绘制各种类型的图,基本的几个如下表所示,示例图见下。
| 函数 | 说明 |
|---|---|
| plt.plot(x,y,fmt, …) | 绘制一个坐标图 |
| plt.boxplot(data,notch,position) | 绘制一个箱体图 |
| plt.bar(left,height,width,bottom) | 绘制一个条形图 |
| plt.barh(width,bottom,left,height) | 绘制一个横向条形图 |
| plt.polar(theta,r) | 绘制极坐标图 |
| plt.pie(data,explode) | 绘制饼图 |
| plt.pas(x,NFFT=256,pad_to,Fs) | 绘制功率谱密度图 |
| plt.specgram(x,NFFT=256,pad_to,F) | 绘制谱图 |
| plt.cohere(x,y,NFFT=256,Fs) | 绘制X-Y的相关性函数 |
| plt.scatter(x,y) | 绘制散点图,其中,x和y长度相同 |
| plt.step(x,y,where) | 绘制步阶图 |
| plt.hist(x,bins,normed) | 绘制直方图 |
| plt.contour(X,Y,Z,N) | 绘制等值图 |
| plt.vlines() | 绘制垂直图 |
| plt.stem(x,y,linefmt,markerfmt) | 绘制柴火图 |
| plt.plot_date() | 绘制数据日期 |
plot 示例图

boxplot 示例图

bar 示例图

barh 示例图

polar 示例图

pie 示例图

pas 示例图

specgram 示例图

cohere 示例图

scatter 示例图

step 示例图

hist 示例图

contour 示例图

vlines 示例图

stem 示例图

plot_date 示例图
