雷达图所用代码
import numpy as up import matplotlib.pyplot as plt import matplotlib matplotlib.rcParam['font.family']='SimHei' matplotlib.rcParam['font.sans-sarif']=['SimHei'] labels=np.array(['第二周作业','第三周作业','第四周作业','第五周作业','第六周作业']) nAttr=5 data=np.array(['90.9','87.5','100','90.9','87.5']) angles=np.linspace(0,2*np.pi,nAttr,endpoint=False) data=np.concate((data,[data[0]])) angles=np.concatenate((angles,[angles[0]])) fig=plt.figure(facecolor="white") plt.subplot(111,polar=True) plt.plot(angles,data,'bo-',color='g',linewidth=2) plt.fill(angles,data,facecolor='g',alpha=0.25) plt.thetagrids(angles*180/np.pi,labels) plt.figtext(0.52,0.95,'python学习成绩图',ha='center') plt.grid(Ture) plt.savefig('学习成绩.jpg') plt.show()