Python-matplotlib.pyplot库
matplotlib.pyplot库的介绍
1.import matplotlib.pyplot as plt(模块别名) 导入matplotlib.pyplot
2.plt.savefig(fname,dpi=None) 将输出图形存储为文件,默认png格式,dpi可修改输出质量
3.plt.axis([Xmin, Xmax, Ymin, Ymax]) 指定输出坐标轴的范围
pyplot的plot函数
plt.plot(x, y, format_string, **kwargs)
x: X轴数据,列表或数组,可选
y: Y轴数据,列表或数组
format_string: 控制曲线的格式字符串,可选
由颜色字符、风格字符和标记字符组成
color: 控制颜色,color=’green’
linestyle: 线条风格,linestyle=’dashed’
marker: 标记风格,marker=’o’
markerfacecolor: 标记颜色,markerfacecolor=’blue’
markersize: 标记尺寸,markersize=20
......
**kwargs: 第二组或更多(x, y, format_string)
(当绘制多条曲线时,各条曲线的x不能省)
pyplot的中文显示:(pyplot不默认支持中文显示)
1.matplotlib.rcParams[‘font.fami