import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams[‘font.family‘]=‘SimHei‘ matplotlib.rcParams[‘font.sans-serif‘]=[‘SimHei‘] labels=np.array([‘week2‘,‘week3‘,‘weef4‘,‘week5‘,‘week6‘]) nAttr=5 Python=np.array([110,100,100,110,80]) angles=np.linspace(0,2*np.pi,nAttr,endpoint=False) Python=np.concatenate((Python,[Python[0]])) angles=np.concatenate((angles,[angles[0]])) fig=plt.figure(facecolor="white") plt.subplot(111,polar=True) plt.plot(angles,Python,‘bo-‘,color=‘g‘,linewidth=2) plt.fill(angles,Python,facecolor=‘g‘,alpha=0.2) plt.thetagrids(angles*180/np.pi,labels) plt.figtext(0.52,0.95,‘2019310143034陈亿东的成绩表‘,ha=‘center‘) plt.grid(True) plt.savefig(‘chenyid.JPG‘) plt.show()
原文:https://www.cnblogs.com/dongyichen/p/13060533.html