使用Python绘制雷达图
来源:互联网 发布:清朝灭亡 知乎 编辑:程序博客网 时间:2024/04/29 19:57
假设某天某地每三个小时取样的气温为
0时
3时
6时
9时
12时
15时
18时
21时
24时
3℃
5℃
6℃
3℃
1℃
3℃
3℃
2℃
3℃
针对温度变化趋势绘制雷达图:
代码如下:
import numpy as np
import matplotlib.pyplot as plt
#标签
labels = np.array(['3℃','5℃','6℃','3℃','1℃','3℃','3℃','2℃'])
#数据个数
dataLenth = 8
#数据
data = np.array([3,5,6,3,1,3,3,2])
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)
ax.plot(angles, data, 'ro-', linewidth=2)
ax.set_thetagrids(angles * 180/np.pi, labels, fontproperties="SimHei")
ax.set_title("温度变化雷达图", va='bottom', fontproperties="SimHei")
ax.grid(True)
plt.show()
import matplotlib.pyplot as plt
#标签
labels = np.array(['3℃','5℃','6℃','3℃','1℃','3℃','3℃','2℃'])
#数据个数
dataLenth = 8
#数据
data = np.array([3,5,6,3,1,3,3,2])
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)
ax.plot(angles, data, 'ro-', linewidth=2)
ax.set_thetagrids(angles * 180/np.pi, labels, fontproperties="SimHei")
ax.set_title("温度变化雷达图", va='bottom', fontproperties="SimHei")
ax.grid(True)
plt.show()
阅读全文
0 0
- 使用Python绘制雷达图
- OWC11绘制雷达图
- OWC11绘制雷达图
- Tableau绘制雷达图
- jQuery 图表插件 jqChart 使用绘制雷达图
- iOS 雷达图的绘制 贝塞尔曲线的使用UIBezierPath
- 自定义View绘制雷达图
- 利用Canvas绘制雷达图
- python 画雷达图
- Android雷达图(蜘蛛网图)绘制
- GDI+绘制极坐标图、雷达图
- 利用d3.js绘制雷达图
- Mesh绘制雷达图(UGUI)
- 微信小程序 canvas绘制雷达图
- 在Unity中使用uGUI绘制自定义图形(饼状图 雷达图)
- [python]使用python实现蜡烛图绘制
- [iOS 绘制蜘蛛网状的雷达图-六边形图]
- Android 自定义View练习:雷达图(比重)绘制
- HDU-1171 Big Event in HDU (多重背包)
- 设计模式---装饰模式
- Eclipse安装svn插件的几种方式
- 2.Spark Streaming:基本工作原理
- 进程间的通信----有名管道fifo
- 使用Python绘制雷达图
- 卡尔曼滤波和维纳滤波
- ubuntu繁体字简体字切换
- 用Leangoo管理你的项目
- python入门第一步,python怎样入门
- 从零开发B/S机架应用程序(四)-TCP
- Spring注入复杂类型属性
- 文章标题
- 关于VB.NET中多窗体之间的调用与关闭