在cmd中,输入python -m pip install matplotlib进行自动的安装,系统会自动下载安装包
转自:/zzxzzx/article/details/83099583
画图:
1.
import matplotlib.pyplot as pltlabels='frogs','hogs','dogs','logs'sizes=15,20,45,10colors='yellowgreen','gold','lightskyblue','lightcoral'explode=0,0.1,0,0plt.pie(sizes,explode=explode,labels=labels,colors=colors,autopct='%1.1f%%',shadow=True,startangle=50)plt.axis('equal')plt.show()
2.
import matplotlib.pyplot as pltplt.plot([1,2,3,4])plt.ylabel('some numbers')plt.show()