Normalized Wind Rose Plot help
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
E. Cheynet
2023-6-25
For the direction with meteorological conventions, you can simply give a new direction newD = 90-oldD
采纳的回答
Star Strider
2023-6-23
Perhaps something like this —
LD = load('winddata.mat');
N = LD.N;
N.WD_Rad = deg2rad(N.WD_Deg) % Add Radian Variable (For Convenience, Since 'polarplot' Requires It)
[UDir,ix,iv] = unique(N.WD_Rad); % Unique Radian Values & Indices (Sorted)
Concv = accumarray(iv, (1:numel(iv)).', [], @(x)numel(N.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) % Plot 'stairs' Stepwise Result
figure
polarplot(UDir, Concv) % Plot Continuous Result
figure
polarhistogram(N.WD_Rad, UDir) % Plot Using 'polarhistogram'
Make appropriate changes to get the result you want.
Using the accumarray function, it is possible to get other parameters of the concentration, such as the mean or median values, as well as standard deviations (std and metrics derived from it, such as confidence intervals) and plot them also using the patch function (although that is more complicated and requires calculating them in polar coordinates and then using the pol2cart function first, and plotting them in Cartesian coordinates), not only the counts.
.
4 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Geographic Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!