Matplotlib绘制蜘蛛图、雷达图
生活随笔
收集整理的這篇文章主要介紹了
Matplotlib绘制蜘蛛图、雷达图
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
import numpy as np
import matplotlib.pyplot as pltplt.rcParams['font.family'] = 'Microsoft YaHei'
labels=np.array(["個?能?","IQ","服務(wù)意識","團隊精神","解決問題能?","持續(xù)學(xué)習(xí)"])
stats=[83, 61, 95, 67, 76, 88]# 畫圖數(shù)據(jù)準備,?度、狀態(tài)值
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) # 填充# 設(shè)置?度
ax.set_thetagrids(angles*180/np.pi,#?度值labels,fontsize = 18)ax.set_rgrids([20,40,60,80],fontsize = 18)
總結(jié)
以上是生活随笔為你收集整理的Matplotlib绘制蜘蛛图、雷达图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android开发系列——实战篇11:多
- 下一篇: 新安装的C4D 无法直接拖入obj文件和