雷達圖所用代碼
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()