【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);

参考

相关推荐
rit84324991 小时前
MATLAB中Teager能量算子提取与解调信号的实现
开发语言·matlab
我找到地球的支点啦2 小时前
通信扩展——扩频技术(超级详细,附带Matlab代码)
开发语言·matlab
Dev7z14 小时前
基于 MATLAB 的铣削切削力建模与仿真
开发语言·matlab
fengfuyao98516 小时前
基于MATLAB的表面织构油润滑轴承故障频率提取(改进VMD算法)
人工智能·算法·matlab
机器学习之心16 小时前
基于随机森林模型的轴承剩余寿命预测MATLAB实现!
算法·随机森林·matlab
rit843249918 小时前
基于MATLAB的环境障碍模型构建与蚁群算法路径规划实现
开发语言·算法·matlab
hoiii18719 小时前
MATLAB SGM(半全局匹配)算法实现
前端·算法·matlab
yong999019 小时前
MATLAB面波频散曲线反演程序
开发语言·算法·matlab
yugi98783821 小时前
基于MATLAB的一键式EMD、EEMD、CEEMD和SSA信号去噪实现
开发语言·matlab·信号去噪
youcans_21 小时前
【STM32-MBD】(15)Simulink 模型开发之三相互补 PWM
stm32·单片机·嵌入式硬件·matlab·foc