matplotlib中pyplot的一些绘图代码
绘图类型
方法 | 含义 |
---|---|
matplotlib.pyplot.angle_spectrum | 绘制电子波谱图 |
matplotlib.pyplot.bar | 绘制柱状图 |
matplotlib.pyplot.barh | 绘制直方图 |
matplotlib.pyplot.broken_barh | 绘制水平直方图 |
matplotlib.pyplot.contour | 绘制等高线图 |
matplotlib.pyplot.errorbar | 绘制误差线 |
matplotlib.pyplot.hexbin | 绘制六边形图案 |
matplotlib.pyplot.hist | 绘制柱形图 |
matplotlib.pyplot.hist2d | 绘制水平柱状图 |
matplotlib.pyplot.pie | 绘制饼状图 |
matplotlib.pyplot.quiver | 绘制量场图 |
matplotlib.pyplot.scatter | 散点图 |
matplotlib.pyplot.specgram | 绘制光谱图 |
定义图像样式
连线图
方法 | 含义 |
---|---|
alpha= | 设置线型的透明度,从 0.0 到 1.0 |
color= | 设置线型的颜色 |
fillstyle= | 设置线型的填充样式 |
linestyle= | 设置线型的样式 |
linewidth= | 设置线型的宽度 |
marker= | 设置标记点的样式 |
散点图
方法 | 含义 |
---|---|
s= | 散点大小 |
c= | 散点颜色 |
marker= | 散点样式 |
cmap= | 定义多类别散点的颜色 |
alpha= | 点的透明度 |
edgecolors= | 散点边缘颜色 |