Creating a "clock" plot, like polarplot.

6 ビュー (過去 30 日間)
dormant
dormant 2023 年 12 月 27 日
コメント済み: Dyuman Joshi 2023 年 12 月 30 日
Is it possible to create a polar-like plot or histogram where the theta values are in minutes between 0 and 60?
I can do it by converting the values to radians and setting the labels, but it would be less-error prone if the theta scale was settable (ThetaLim doesn't do this).
WT = [ 1 2 3 5 42 43 59.5 0.5];
theta = deg2rad( WT*6 );
edges = deg2rad(-5:10:355);
figure;
pax = polaraxes;
polarhistogram( theta, edges );
pax.ThetaDir = 'clockwise';
pax.ThetaZeroLocation = 'top';
pax.ThetaTick = [0 90 180 270 360];
pax.ThetaTickLabel = [0 15 30 45 60];
pax.RTick = [];
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 30 日
@dormant, The method you've come up with seems like a good approach.
I think the (accepted) answer does not understood or acknowledge what the expected output is.

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

採用された回答

Hassaan
Hassaan 2023 年 12 月 27 日
移動済み: Voss 2023 年 12 月 27 日
WT = [ 1 2 3 5 42 43 59.5 0.5];
theta = deg2rad(WT*6);
edges = deg2rad(-0.5:1:60.5);
figure;
pax = polaraxes;
polarhistogram(theta, edges);
pax.ThetaDir = 'clockwise';
pax.ThetaZeroLocation = 'top';
pax.ThetaTick = [0 90 180 270 360];
pax.ThetaTickLabel = {'0' '15' '30' '45' '60'};
pax.RTick = [];
The code snippet provided is a good starting point and, with a few adjustments, it should be able to produce a reliable and accurate clock-like polar histogram plot.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
  1 件のコメント
dormant
dormant 2023 年 12 月 28 日
Many thanks. I'll try and write it as a function for future use.
I will try and include an option to produce a polar stem plot instead of a polar histogram, because the latter is often over-emphatic.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by