Plotting Polar Plots using time series data

10 ビュー (過去 30 日間)
Jake
Jake 2025 年 2 月 6 日
コメント済み: Mathieu NOE 2025 年 2 月 7 日
I have time series data for angle and speed (sample attached). I can plot the angel on a polarhistogram as follows.
load("sampleData.mat")
whos
Name Size Bytes Class Attributes angle 1x15000 120000 double ans 1x38 76 char speed 1x15000 120000 double time 1x15000 120000 double
figure
h=polarhistogram(angle);
set(gca,'ThetaTick', [0 30 60 90 120 150 180 210 240 270 300 330], ...
'ThetaTickLabel',{0 30 60 90 120 150 180 210 240 270 300 330})
set(gca,'ThetaZeroLocation','top','ThetaDir','clockwise');
h.DisplayStyle = 'stairs';
But I want to include the speed within the plot too, something similar to a countourf plot or Perfect Polar Plots as below. I tried using the custom function, but I couldn't make it work. How can I do this?
  3 件のコメント
Jake
Jake 2025 年 2 月 7 日
Hi @Mathieu NOE, thank you for this suggestion. I agree that this is kind of a better option when the angle range is very small. I like this one and the answer you suggested :)
Mathieu NOE
Mathieu NOE 2025 年 2 月 7 日
hello Jake
glad I could be of some help !

サインインしてコメントする。

採用された回答

Mathieu NOE
Mathieu NOE 2025 年 2 月 6 日
編集済み: Mathieu NOE 2025 年 2 月 6 日
hello again
well, maybe I'm stupid but I coud not yet figure out how to use Perfect Polar Plots without having to spend some time to create a density map with the correct dimensions.
so the quick and dirty alternative I can propose is a modified version of dscatter (mentionned above in my comment ) , so let's call it dscatterpolar (see attached)
sorry to the community and to TMW to have frankensteined the original dscatter function !!!
result :
as i said before , the data does not cover a wide angular range so we're left with that narrow beam plot
the ticks in radial correspond to the wind speed
code : in one line
load('sampleData.mat')
% whos
% Name Size Bytes Class Attributes
%
% angle 1x15000 120000 double
% speed 1x15000 120000 double
% time 1x15000 120000 double
figure(1)
[hAxes,col,ctrs1,ctrs2,F] = dscatterpolar(speed(:),angle(:)*pi/180); % make sure you pass the data speed first and angle in second (and in rad).
  9 件のコメント
Jake
Jake 2025 年 2 月 7 日
Hi @Mathieu NOE, Thank you for all the help - this is good :)
You're right - I made the silly mistake of passing degrees instead of radians to polarhistogram!
Mathieu NOE
Mathieu NOE 2025 年 2 月 7 日
as always, my pleasure !
tx for accepting my suggestions !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by