失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > Matplotlib绘制蜘蛛图 雷达图

Matplotlib绘制蜘蛛图 雷达图

时间:2019-04-16 06:42:19

相关推荐

Matplotlib绘制蜘蛛图 雷达图

import numpy as npimport matplotlib.pyplot as pltplt.rcParams['font.family'] = 'Microsoft YaHei'labels=np.array(["个⼈能⼒","IQ","服务意识","团队精神","解决问题能⼒","持续学习"])stats=[83, 61, 95, 67, 76, 88]# 画图数据准备,⻆度、状态值angles=np.linspace(0, 2*np.pi, len(labels), endpoint=False)stats=np.concatenate((stats,[stats[0]]))angles=np.concatenate((angles,[angles[0]]))# ⽤Matplotlib画蜘蛛图fig = plt.figure(figsize=(9,9))ax = fig.add_subplot(111, polar=True)ax.plot(angles, stats, 'o-', linewidth=2) # 连线ax.fill(angles, stats, alpha=0.25) # 填充# 设置⻆度ax.set_thetagrids(angles*180/np.pi,#⻆度值labels,fontsize = 18)ax.set_rgrids([20,40,60,80],fontsize = 18)

如果觉得《Matplotlib绘制蜘蛛图 雷达图》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。