import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cairosvg
from openpyxl import load_workbook
import time
def plot_radar(data,lables,id):
'''
the first column of the data is the cluster name;
the second column is the number of each cluster;
the last are those to describe the center of each cluster.
'''
# labels = data.iloc[:, 2:].columns
# centers = pd.concat([data.iloc[:, 2:], data.iloc[:, 2]], axis=1)
lables=["","","","","","","","",""]
for ele in range(len(id)):
plt.rcParams["font.sans-serif"] = ["KaiTi"]
# plt.rcParams['font.family'] = 'YaHei Consolas Hybrid' # 设置字体样式
plt.rcParams['font.size'] = '15' # 设置字体大小
plt.rcParams["axes.unicode_minus"] = False
centers=[data[ele]]
for i in range(len(centers[0])):
# centers[0][i
centers[0][i]/=10
centers[0].append(centers[0][0])
centers = np.array(centers)
n = 8
python 使用matlab库绘制雷达图(包含读取处理excel数据)
最新推荐文章于 2022-09-05 17:16:02 发布
本文介绍了如何在Python中使用matplotlib库读取Excel数据并绘制雷达图。详细步骤包括数据预处理、设置雷达图参数以及绘制图形的过程。

最低0.47元/天 解锁文章
2653

被折叠的 条评论
为什么被折叠?



