Python簡單雷達圖繪制


import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['font.family'] = 'SimHei'
matplotlib.rcParams['font.sans-serif'] = ['SimHei']
lables = np.array(['綜合','KDA','發育','推進','生存','輸出'])
nAttr = 6
date = np.array([7, 5, 6, 9, 8, 7])
angles = np.linspace(0, 2*np.pi, nAttr, endpoint=False)
date = np.concatenate((date, [date[0]]))
angles = np.concatenate((angles, [angles[0]]))
fig = plt.figure(facecolor="white")
plt.subplot(111, polar=True)
plt.plot(angles, date, 'bo-', color = 'g', linewidth = 2)
plt.fill(angles, date, facecolor = 'g', alpha = 0.25)
plt.thetagrids(angles*180/np.pi, lables)
plt.figtext(0.52, 0.95, 'DOTA能力值雷達圖', ha='center')
plt.grid(True)
plt.savefig('dota_radar.JPG')
plt.show()
效果圖:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM