首页 > 编程语言 > 详细

Python成绩雷达图

时间:2019-04-21 00:51:14      阅读:448      评论:0      收藏:0      [点我收藏+]
代码
1 import numpy as np 2 import matplotlib 3 import matplotlib.pyplot as plt 4 matplotlib.rcParams[font.family]=SimHei 5 matplotlib.rcParams[font.sans-serif]=SimHei 6 labels=np.array([第一周,第二周,第三周,第四周,第五周,第六周,第七周]) 7 nAttr=7 8 data=np.array([0,8.7,10,8,9.7,8.1,0]) 9 angles=np.linspace(0,2*np.pi,nAttr,endpoint=False) 10 data=np.concatenate((data,[data[0]])) 11 angles=np.concatenate((angles,[angles[0]])) 12 fig=matplotlib.pyplot.figure(facecolor="white") 13 matplotlib.pyplot.figure(facecolor="white") 14 matplotlib.pyplot.subplot(111,polar=True) 15 matplotlib.pyplot.plot(angles,data,bo-,color=g,linewidth=2) 16 matplotlib.pyplot.fill(angles,data,facecolor=g,alpha=0.25) 17 matplotlib.pyplot.thetagrids(angles*180/np.pi,labels) 18 matplotlib.pyplot.figtext(0.52,0.95,SG.zhang成绩雷达图,ha=center) 19 matplotlib.pyplot.grid(True) 20 matplotlib.pyplot.savefig(dota_radar.JPG) 21 matplotlib.pyplot.show()

运行结果

技术分享图片

Python成绩雷达图

原文:https://www.cnblogs.com/SGzhang/p/10743512.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!