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

参考

相关推荐
2zcode1 天前
项目文档:基于MATLAB低采样率ISAR成像的快速稀疏重建算法研究
开发语言·算法·matlab
matlab代码1 天前
Matlab基于主成分分析PCA人脸识别系统(GUI界面)【源码44期】
开发语言·matlab·人脸识别
茗创科技2 天前
CGE连接组:用基因表达解码脑疾病的异质性(附高分文献下载)
python·matlab·脑网络
EW Frontier3 天前
GRAIL-SCML:一种几何正则化自适应集成似然的波达方向估计算法【附MATLAB代码】
matlab·自适应·宽带·doa估计·波达方向估计·几何正则化·窄带
程高兴3 天前
三相维也纳整流器仿真Simulink(解决过零畸变问题)
matlab
通信仿真爱好者3 天前
第【70】期--noma与ofdma在无线网络中的性能对比分析--MATLAB完整代码
matlab·非正交多址接入·noma·ofdma
爱吃提升4 天前
MATLAB impulse函数脉冲响应完整实操教程
开发语言·matlab
我爱C编程4 天前
基于K层下行异构蜂窝网络的网络覆盖率和速率计算matlab仿真
网络·matlab·异构蜂窝网络·k层下行·网络覆盖率
逆向编程4 天前
MATLAB rlocus函数根轨迹完整实操教程
开发语言·matlab
@陈小鱼4 天前
MATLAB+Python:基于小样本卷积神经网络的 PPG 血压预测
人工智能·python·机器学习·matlab·脉搏波·血压·一维卷积神经网络