matplotlib系列—pyplot基础图表函数概述
pyplot可以用来绘制非常多的图形图表,在这里简单介绍16个常见的图表函数。
pyplot图表函数 | 说明 |
---|---|
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.psd(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() | 数据日期 |
参考资料:北京理工大学嵩天老师教学视频