1、matplotlib.pyplot绘图相关对象
(1)容器类:图(figure)、坐标系(axes)、坐标轴(aris)、刻度(tick)
(2)基础类:线(line)、点(marker)、文本(text)、图例(legend)、网格(grid) 、标题(title)
2、绘图的类型:
(1)线形图:plot()
(2)直方图: hist()
(3)条形图: bar()
(4)饼图: pie()
(5)散点图: scatter()
(6)3D图: from mpl_toolkits.mplt3d impart Axes3D
(7)动态交互图:pyecharts
import matplotlib.pyplot as plt #导入第三方库,别名为plt #(1)线形图:plot() #plt.plot([1,2,5,7,6]) #plt.plot([1,2,5,7,6],[3,6,7,0,9]) #第一个数组为x坐标,第二数组为y坐标,如果只有一个数组是y坐标,系统自动生成x坐标为0,1,2... #plt.plot((2,7),(4,0),(6,7),(5,8)) plt.plot([2,5,6,3,2],[2,2,4,4,2]) plt.axis([0,10,0,10]) #设置坐标轴的范围,用数组表达不能直接用数组 plt.savefig('../R&Q_pic/test0.png',dpi=600) plt.show()