Normalized Wind Rose Plot help
Afficher commentaires plus anciens
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 commentaires
VBBV
le 23 Juin 2023
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
le 24 Juin 2023
Déplacé(e) : VBBV
le 25 Juin 2023
E. Cheynet
le 25 Juin 2023
For the direction with meteorological conventions, you can simply give a new direction newD = 90-oldD
Réponse acceptée
Plus de réponses (1)
Douglas Leaffer
le 22 Déc 2023
3 commentaires
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
le 22 Déc 2023
Star Strider
le 22 Déc 2023
As always, my pleasure!
Catégories
En savoir plus sur Polar Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











