matplotlib
“hello world”of matplotlib
1 | x=[1,2,3] |
基本运用函数
matplotlib.pyplot模块中:
plot()
画2d图,基本使用方式与matlab中相同
figure()
Create a new figure, or activate an existing figure.
figure会包装后面的与matplotlib相关代码将画的图放在一个画布中,直到另一个figure被使用
xlabel和ylabel
给轴加标签,也可以理解为坐标轴的名字
xticks和yticks
获取或设置坐标轴的当前刻度位置和标签。
legend((line1, line2, line3), (‘label1’, ‘label2’, ‘label3’))
图例



