Normalized Wind Rose Plot help
古いコメントを表示
I am trying to generate a normalized (to the max) wind rose plot of air pollutant concentration (UFP) by wind direction. See photo below. A data vector is attached. The simple code: polarplot(N.WD_Deg,N.UFPConc) doesn't generate what I want. Any help is appreciated. Thank you

load winddata.mat
polarplot(N.WD_Deg,N.UFPConc)
4 件のコメント
VBBV
2023 年 6 月 23 日
Try using polarhistogram function
One way is to use the data for air pollution concentration directly and compare with direction data as shown below
Data = load('winddata.mat')
Data.N;
%
subplot(121)
polarplot(Data.N.WD_Deg(1:10000:end),'linewidth',2,'Color','red')
title('Wind direction [deg]')
subplot(122) % normalized plot of air pollutant data
polarplot(Data.N.UFPConc(1:10000:end)./max(Data.N.UFPConc(1:10000:end)),'linewidth',2,'Color','red')
title('Air pollutant concentration')
since polarplot by default uses direction data for its axes, yoou can use that pollutant data directly. Othwerwise, you can also apply conditions for direction data bins and filter the air pollutant concentration data , then plot it. Further, the data points in the table are many, so its better to filter the air pollutant data using bin averaged directional means which will be representative of the air pollutant concentration
Douglas Leaffer
2023 年 6 月 24 日
移動済み: VBBV
2023 年 6 月 25 日
E. Cheynet
2023 年 6 月 25 日
For the direction with meteorological conventions, you can simply give a new direction newD = 90-oldD
採用された回答
その他の回答 (1 件)
Douglas Leaffer
2023 年 12 月 22 日
3 件のコメント
To normalise them, divide by the maximum:
Concv = Concv/max(Concv);
Try this —
load CR_1hr_wind.mat
NC = normalize(CT1,"norm",Inf,"DataVariables","UFPConc");
NC.WD_Rad = deg2rad(NC.WD_Deg) % Add Radian Variable (For Convenience, Since 'polarplot' Requires It)
[UDir,ix,iv] = unique(NC.WD_Rad); % Unique Radian Values & Indices (Sorted)
Concv = accumarray(iv, (1:numel(iv)).', [], @(x)numel(NC.UFPConc(x))); % Accumulate Count Values Of 'UFPConc' By Direction (Use 'numel' To Count Occurrences)
%[sDir, sConc] = stairs(UDir, Concv); % Return 'stairs' Stepwise Result
%figure
%polarplot(sDir, sConc)
Concv = Concv/max(Concv);
figure
%subplot (121)
polarplot(UDir, Concv, 'LineWidth', 4) % Plot Continuous Result
Ax = gca;
Ax.ThetaZeroLocation = 'top';
Ax.ThetaDir = 'clockwise';
If you intend something else, please be specific.
.
Douglas Leaffer
2023 年 12 月 22 日
Star Strider
2023 年 12 月 22 日
As always, my pleasure!
カテゴリ
ヘルプ センター および File Exchange で Polar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











