【MATLAB基础绘图第17棒】绘制玫瑰图

MATLAB绘制玫瑰图

玫瑰图(Nightingale Rose Chart)

玫瑰图(Nightingale Rose Chart),又名鸡冠花图(Coxcomb Chart)、极坐标区域图(Polar Area Diagram),是极坐标化的柱图,可以将其理解为披着饼图外皮的柱状图。

风玫瑰图(WindRose)

风玫瑰图(Wind rose diagram)是一种特殊的极坐标堆叠图/统计直方图,其能够直观地表示某个地区一段时期内风向、风速的发生频率。

准备工作:WindRose工具包下载

由于Matlab中未收录风玫瑰图的绘制函数,因此需要大家自行设法解决。此处,采用WindRose工具包绘制风玫瑰图。

MATLAB帮助-Wind Rose

案例

案例1:基础绘图

MATLAB代码如下:

clike 复制代码
clc
close all
clear
%% 函数说明-风玫瑰图绘制

pathFigure= '.\Figures\' ;
figureUnits = 'centimeters';
figureWidth = 18; 
figureHeight = 15;

%% 导入数据

load('data.mat');
direction = data(:,1);    % 风向
speed = data(:,2);         % 风速

%% 开始绘图

Options = {'anglenorth',0,...     'The angle in the north is 0 deg (this is the reference from our data, but can be any other)
           'angleeast',90,...              'The angle in the east is 90 deg
           'labels',{'N (0°)','NE (45°)','E (90°)','SE (135°)','S (180°)','SW (225°)','W (270°)','NW (315°)'},... 'If you change the reference angles, do not forget to change the labels.
           'freqlabelangle',45};
figureHandle = WindRose(direction,speed,Options);
set(gcf, 'Units', figureUnits, 'Position', [0 0 figureWidth figureHeight]);
set(gca,'FontSize',12,'Fontname', 'Times New Roman');

其中,'Options'为自定义绘图参数集,包括标签、标题、图例、配色、组数等等,可以根据自己的需要进行设置。

成图如下所示:

绘制完成后,按所需格式、分辨率导出图像:

clike 复制代码
str= strcat(pathFigure, "风玫瑰图", '.tiff');
print(gcf, '-dtiff', '-r600', str);

参考

相关推荐
fie888920 小时前
基于 MATLAB 的前景背景分割系统
开发语言·matlab
2zcode1 天前
基于MATLAB的5G物理层文本传输系统仿真与性能分析
开发语言·5g·matlab
feifeigo1231 天前
基于布谷鸟算法的配电网分布式电源选址定容 MATLAB 实现
开发语言·算法·matlab
rit84324991 天前
基于MATLAB平台的指纹识别系统实现
开发语言·matlab
机器学习之心1 天前
多工况车速数据集训练BiLSTM-Attention用于车速预测,输出未来多个时间步车速,MATLAB代码
matlab·attention·bilstm·车速预测
jghhh011 天前
燃料电池电源 Matlab 仿真方案
开发语言·matlab
wearegogog1231 天前
用于脑电信号(EEG)分类的 SVM 分类器 Matlab 实现
支持向量机·matlab·分类
zhangfeng11331 天前
openclaw skills 小龙虾技能 通讯仿真 matlab skill Simulink Agentic Toolkit,通过kimi找到,mcp通讯
开发语言·matlab·openclaw·通讯仿真
chao1898441 天前
基于 SPEA2 的多目标优化算法 MATLAB 实现
开发语言·算法·matlab
yongui478342 天前
基于 GA 优化的 BP 神经网络算法分析与 MATLAB 实现
神经网络·算法·matlab