yeluozhiqiumax
import numpy as np
import matplotlib.pyplot as plt

#标签
labels = np.array([\'第一周\',\'第二周\',\'第三周\',\'第四周\',\'第五周\',\'第六周\'])
#数据个数
dataLenth = 6
#数据
data = np.array([50,100,90,100,110,70])

angles = np.linspace(0, 2*np.pi, dataLenth, endpoint=False)
data = np.concatenate((data, [data[0]])) # 闭合
angles = np.concatenate((angles, [angles[0]])) # 闭合

fig = plt.figure()
ax = fig.add_subplot(111, polar=True)# polar参数!!
ax.plot(angles, data, \'bo-\', linewidth=2)# 画线
ax.fill(angles, data, facecolor=\'b\', alpha=0.55)# 填充
ax.set_thetagrids(angles * 180/np.pi, labels, fontproperties="SimHei")
ax.set_title("刘世童(学号:2019310143049)成绩雷达图", va=\'bottom\', fontproperties="SimHei")
ax.set_rlim(0,110)
ax.grid(True)
plt.show()
代码

效果图:

 

分类:

技术点:

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-12-23
  • 2022-02-25
  • 2021-12-20
  • 2021-08-17
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2021-03-31
  • 2021-07-16
  • 2021-09-06
相关资源
相似解决方案