科学计算库学习报告

一.numpy与matplotlib的读书笔记:

调用数据库要先安装数据库然后熟悉调用数据库才能更好地做用函数库来绘画自己的图案

二.雷达图绘制

 1 # -*- coding: utf-8 -*-
 2 """
 3 Spyder Editor
 4 
 5 This is a temporary script file.
 6 18信计二班黎志柱
 7 
 8 """
 9 import numpy as np
10 import matplotlib.pyplot as plt
11 import matplotlib
12 matplotlib.rcParams['font.family']='SimHei'
13 matplotlib.rcParams['font.sans-serif']=['SimHei']
14 labels=np.array(['综合','第二周','第三周','第四周','第五周','第六周'])
15 nAttr=6
16 data=np.array([91,91,87,100,93,87])
17 angles=np.linspace(0,2*np.pi,nAttr,endpoint=False)
18 data=np.concatenate((data,[data[0]]))
19 angles=np.concatenate((angles,[angles[0]]))
20 fig=plt.figure(facecolor="pink")
21 plt.subplot(111,polar=True)
22 plt.plot(angles,data,'bo-',color='r',linewidth=2)
23 plt.fill(angles,data,facecolor='yellow',alpha=0.25)
24 plt.thetagrids(angles*180/np.pi,labels)
25 plt.figtext(0.52,0.92,'21号黎志柱成绩雷达图',ha='center')
26 plt.grid(True)
27 plt.savefig('dota_radar.JPG')
28 plt.show
原文地址:https://www.cnblogs.com/lzz807237221/p/10747088.html