当前位置: 首页 > news >正文

MATLAB绘制雷达图/蜘蛛图

雷达图/蜘蛛图

1 方法一

函数来源为MATLAB | 如何使用MATLAB绘制雷达图(蜘蛛图)

1.1 调用函数

1.2 案例

2 方法二

函数来源为MATLAB帮助-spider_plot

2.1 调用函数

语法(Syntax):

spider_plot(P)spider_plot(P, Name, Value, ...)h = spider_plot(_)

输入变量:

  • P:用于绘制蜘蛛图的数据点。行是数据组,列是数据点。如果没有指定轴标签和轴限制,则自动生成。[向量|矩阵]

输出变量:

  • h:蜘蛛图的图柄。(图对象)

名称-值对参数(Name-Value Pair Arguments):

名称说明备注
AxesLabels用于指定每个轴的标签[自动生成(默认)/单元格的字符串/ ‘none’]
AxesInterval用于更改显示在网页之间的间隔数[3(默认值)/ integer]
AxesPrecision用于更改轴上显示的值的精度级别[1(默认)/ integer / vector]
AxesDisplay用于更改显示轴文本的轴数。'None’或’one’可用于简化规范化数据的图形外观[‘none’(默认)/ “没有”/“一”/“数据”/“data-percent”]

2.2 案例

2.2.1 案例1:

成图如下所示:
在这里插入图片描述
MATLAB实现代码如下:

clc
close all
clear
%% 导入数据
pathFigure= '.\Figures\' ;
%% Example 1
% Initialize data points
D1 = [5 3 9 1 2];   
D2 = [5 8 7 2 9];
D3 = [8 2 1 4 6];
P = [D1; D2; D3];% Spider plot
figure(1)
h = spider_plot(P,...'AxesLabels', {'S1', 'S2', 'S3', 'S4', 'S5'},...'FillOption', {'on', 'on', 'off'},...'FillTransparency', [0.2, 0.1, 0.1],...'AxesLimits', [1, 2, 1, 1, 1; 10, 8, 9, 5, 10],...             % [min axes limits; max axes limits]'AxesPrecision', [0, 1, 1, 1, 1],...'LineStyle', {'--', '-', '--'},...'LineWidth', [1, 2, 3],...'AxesFont', 'Times New Roman',...'LabelFont', 'Times New Roman',...'AxesFontSize', 12,...'LabelFontSize', 12,...'AxesLabelsEdge', 'none');% Legend settings
hl = legend('D1', 'D2', 'D3', 'Location', 'northeast');
set(hl,'Box','off','FontSize',14,'Fontname', 'Times New Roman');str= strcat(pathFigure, "Figure1", '.tiff');
print(gcf, '-dtiff', '-r600', str);

2.2.2 案例2:

成图如下所示:
在这里插入图片描述
MATLAB实现代码如下:

clc
close all
clear
%% 导入数据
pathFigure= '.\Figures\' ;
%% Example 2
% Initialize data points
D1 = [5 3 9 1 2 2 9 3 1 9 8 7 2 3 6];
D2 = [5 8 7 2 9 7 6 4 8 9 2 1 8 2 4];
D3 = [8 2 1 4 6 1 8 4 2 3 7 5 6 1 6];
P = [D1; D2; D3];% Spider plot
spider_plot(P,...'AxesLimits', [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;...10 10 10 10 10 10 10 10 10 10 10 10 10 10 10],...'AxesInterval', 5,...'AxesDisplay', 'one',...'AxesPrecision', 0,...'AxesLabelsRotate', 'on',...'AxesLabelsOffset', 0.1,...'AxesRadial', 'off',...'AxesFont', 'Times New Roman',...'LabelFont', 'Times New Roman',...'AxesFontSize', 12,...'LabelFontSize', 12,...'AxesLabelsEdge', 'none');% Legend settings
hl = legend('D1', 'D2', 'D3', 'Location', 'northeast');
set(hl,'Box','off','FontSize',14,'Fontname', 'Times New Roman');str= strcat(pathFigure, "Figure2", '.tiff');
print(gcf, '-dtiff', '-r600', str);

参考

1.MATLAB | 如何使用MATLAB绘制雷达图(蜘蛛图)
2.MATLAB帮助-spider_plot

http://www.lryc.cn/news/19587.html

相关文章:

  • 算法入门,十字路口选择的案例,如果是南方,则向前行
  • 父传子与子传父步骤
  • Java concurrency - Task Execution
  • 浅谈BOM
  • 每日学术速递2.24
  • SpringBoot 面试问答总结(VIP典藏版)
  • CSS 定位网页元素【快速掌握知识点】
  • 构建Docker基础镜像(ubuntu20.04+python3.7.1+chrome101+chromedriver101)
  • 最新最全Java面试知识
  • 个人电脑需求严重疲软,联想集团财务前景仍不乐观
  • 软件测试面试在简历上写了“精通”后,拥有工作经验的我被面试官问到窒息...
  • 色环电容读数方法要点总结
  • C++函数新思想和标准的输入和输出
  • 华为OD机试真题Java实现【汽水瓶】真题+解题思路+代码(20222023)
  • WindownsPowershell中的单引号和双引号
  • 【华为OD机试模拟题】用 C++ 实现 - 数组组成的最小数字(2023.Q1)
  • Ae:使用代理
  • OAuth 2.0 认证和攻击面
  • 论文写作模板
  • (五)物质导数与空间时间导数
  • python实战应用讲解-【语法基础篇】流程控制-运算符(附示例代码)
  • MXNet中使用双向循环神经网络BiRNN对文本进行情感分类
  • SpringBoot 整合 MongoDB 6 以上版本副本集及配置 SSL / TLS 协议
  • C语言static关键字
  • 【华为OD机试模拟题】用 C++ 实现 - 单词接龙(2023.Q1)
  • PHP基础(2)
  • Java8(JDK1.8)新特性
  • 【C语言】指针的定义和使用
  • Parameter ‘zpspid‘ not found
  • 23、高自由度下的E类波形理论计算(附Matlab代码)