Plotting Polar Plots using time series data
古いコメントを表示
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
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 件のコメント
Mathieu NOE
2025 年 2 月 6 日
hello
your angle range is very narrow (178 to 180 °) and I suspect that if you want to plot your density on a polar diagram this will be unreadable as the plot will appear as a very narrow area
instead you can still do a density plot in cartesian coordinates
I am using dscatteravailable here : Flow Cytometry Data Reader and Visualization - File Exchange - MATLAB Central

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] = dscatter(speed(:),angle(:));
xlabel('speed');
ylabel('angle (°)');
grid on
hold on
lb = min(F,[],'all');
ub = max(F,[],'all');
threshold = lb+0.1*(ub-lb); % threshold is 10% of F range above min value
[row,col]=find(F>threshold);
% k = boundary(___,s) specifies shrink factor s using any of the previous syntaxes.
% s is a scalar between 0 and 1. Setting s to 0 gives the convex hull,
% and setting s to 1 gives a compact boundary that envelops the points.
% The default shrink factor is 0.5.
s = 0.75;
k = boundary(row,col,s);
plot(ctrs1(col(k)),ctrs2(row(k)),'r')
hold off
Jake
2025 年 2 月 7 日
Mathieu NOE
2025 年 2 月 7 日
hello Jake
glad I could be of some help !
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Polar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








