# WindRosePlot **Repository Path**: iDMatlab/wind-rose-plot ## Basic Information - **Project Name**: WindRosePlot - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-10-31 - **Last Updated**: 2023-10-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # WindRosePlot ## 详细介绍请关注:好玩的 MATLAB 公众号 ``` clc;clear;close all; windDirections = [0.0, 22.5, 45.0, 67.5, 90.0, 112.5, 135.0, 157.5, 180.0, 202.5, 225.0, 247.5, 270.0, 292.5, 315.0, 337.5]'; windFrequency = [10.2, 4, 4, 3.0, 4.0, 3.0, 4.0, 4.0, 7.0, 6.0, 3, 2, 2, 1.0, 3, 5]'; maxWindSpeed = [15, 12, 10, 5, 5, 5,10, 12, 13, 15, 12,5, 5, 10, 12, 15]'; avgWindSpeed = [2.8, 2.0, 1.5, 1.2, 1.4, 1.3, 1.45, 2.00, 2.80, 2.80, 1.50, 1.00, 1.0, 1.0, 1.8, 2.0]'; data=[windDirections,windFrequency,maxWindSpeed,avgWindSpeed]; % 1、默认绘图: figure('name','默认绘图') w=WindRosePlot(data); w.plot(); % 2、刻度设置: % 2.1设置刻度颜色 figure('name','设置刻度颜色') w=WindRosePlot(data); w.AxisColor=[0,0,1]; w.AxisLineWidth=2; w.plot(); % 2.2 设置刻度方向、长短 figure('name','设置刻度方向、长短') w=WindRosePlot(data); w.AxisMainTickDir='both'; w.AxisMinorTickDir='out'; w.AxisColor=[1,0,0]; w.AxisLineWidth=2; w.AxisTickLength=0.08; w.plot(); % 3、网格设置: figure('name','主、次网格样式、颜色、粗细、透明度') w=WindRosePlot(data); w.RGrid='on'; w.RGridLineStyle='-.'; w.RGridColor=[1,0,0]; w.RGridAlpha=0.5; w.RGridLineWidth=1.5; w.ThetaGrid='on'; w.ThetaGridLineStyle='--'; w.ThetaGridColor=[0,1,0]; w.ThetaGridAlpha=0.5; w.ThetaGridLineWidth=2; w.MinorRGrid='on'; w.MinorRGridLineStyle='-'; w.MinorRGridColor=[1,1,0]; w.MinorThetaGrid='on'; w.MinorThetaGridLineStyle=':'; w.MinorThetaGridColor=[0,0,1]; w.plot(); % 4、设置背景色 figure('name','背景颜色') w=WindRosePlot(data); w.ColorMaps=hsv; w.AxisBackgroundColor=[1,1,1]*0.10; w.AxisFaceAlpha=0.1; w.plot(); % 5 、图列设置 figure('name','图列设置:title设置、背景色、边缘色、边缘粗细、字体属性') w=WindRosePlot(data); w.LegendTitle='图列设置Title'; w.LegendBackgroundColor=[1,.9,.8]*.98; w.LegendEdgeColor='m'; w.LegendLineWidth=4; w.LegendFontName='Times new Roman'; w.LegendFontSize=16; w.LegendFontAngle='normal'; w.LegendFontWeight='bold';%加粗 w.plot(); % 6 、颜色条设置 figure('name','颜色条设置') w=WindRosePlot(data); % load('colorsData/acton100.mat') % load('colorsData/bwr.mat') % load('colorsData/vikO100.mat') % w.ColorMaps=colorsList; % w.ColorMaps=hsv; % w.ColorMaps=bone; % w.ColorMaps=jet; w.ColorMaps=winter; % w.ColorMaps=spring; w.ColorMapsTitle='颜色条 Title测试'; w.ColorMapsFontSize=14; w.ColorMapsFontAngle='italic'; w.plot(); ``` ![输入图片说明](img/output.gif)