Normalized Wind Rose Plot help
Mostrar comentarios más antiguos
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 comentarios
VBBV
el 23 de Jun. de 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
el 24 de Jun. de 2023
Movida: VBBV
el 25 de Jun. de 2023
E. Cheynet
el 25 de Jun. de 2023
For the direction with meteorological conventions, you can simply give a new direction newD = 90-oldD
Respuesta aceptada
Más respuestas (1)
Douglas Leaffer
el 22 de Dic. de 2023
3 comentarios
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
el 22 de Dic. de 2023
Star Strider
el 22 de Dic. de 2023
As always, my pleasure!
Categorías
Más información sobre Polar Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











