• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

nlx秦安

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

python123作业成绩雷达图

import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.rcParams['font.family']='SimHei'
matplotlib.rcParams['font.sans-serif']='SimHei'
labels=np.array(['第一周','第二周','第三周','第四周','第五周','第六周'])
nAttr=6
data=np.array([100,90,90,90,90,90])
angles=np.linspace(0,2*np.pi,nAttr,endpoint=False)
data=np.concatenate((data,[data[0]]))
angles=np.concatenate((angles,[angles[0]]))
fig=matplotlib.pyplot.figure(facecolor="white")
matplotlib.pyplot.figure(facecolor="white")
matplotlib.pyplot.subplot(111,polar=True)
matplotlib.pyplot.plot(angles,data,'bo-',color='g',linewidth=2)
matplotlib.pyplot.fill(angles,data,facecolor='g',alpha=0.25)
matplotlib.pyplot.thetagrids(angles*180/np.pi,labels)
matplotlib.pyplot.figtext(0.52,0.95,'成绩雷达图',ha='center')
matplotlib.pyplot.grid(True)
matplotlib.pyplot.savefig('成绩雷达图.JPG')
matplotlib.pyplot.show()

posted on 2020-05-05 20:09  秦安233  阅读(324)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3