Rose diagram for discrete data

Hi,
I need to draw a rose diagram, however, my data is grouped already. Is it possible to generate a rose diagram for discrete data? Is there any way I can do that? Here is the data I need to plot, for example for 0 degrees I have 56 observations for 10 degrees - 30 observations and so on. I'd appreciate any help. Thank you
  • 0 56
  • 10 30
  • 20 11
  • 30 11
  • 40 5
  • 50 3
  • 60 6
  • 70 8
  • 80 14
  • 90 16
  • 100 15
  • 110 7
  • 120 6
  • 130 9
  • 140 7
  • 150 10
  • 160 21
  • 170 39
  • 180 56
  • 190 30
  • 200 11
  • 210 11
  • 220 5
  • 230 3
  • 240 6
  • 250 8
  • 260 14
  • 270 16
  • 280 15
  • 290 7
  • 300 6
  • 310 9
  • 320 7
  • 330 10
  • 340 21
  • 350 39

 採用された回答

Star Strider
Star Strider 2015 年 3 月 23 日

5 投票

The rose function isn’t cooperating. This is likely as close as you can get:
th_x = [0 56 % Original Data Matrix
10 30
20 11
30 11
40 5
50 3
... ];
xr = [repmat(th_x(:,2)', 10, 1); zeros(1,36)];
xr = [0 reshape(xr, 1, [])];
th = linspace(0, 359, length(xr));
figure(1)
polar(th*pi/180, xr)
producing this plot:

6 件のコメント

Martin
Martin 2018 年 1 月 1 日
Hi,
Is it possible to move the bins from the edges to the centres?
Star Strider
Star Strider 2018 年 1 月 1 日
If you want to define them as centres rather than edges with this code, you will have to use the centres to define the edges, then use the edges.
Note that in R2016b polarhistogram (link) appeared, and in R2016a, polarplot (link) appeared, with significant improvements over polar (that still exists).
Martin
Martin 2018 年 1 月 1 日
Hi, Thanks for the quick reply. I am sorry; I do not really follow how that is done. I work mainly with ArcGIS, so my Matlab skills are still quite poor.
I have determined wind directions from some landforms and now I am trying to plot it in a rose diagram. I have grouped the data in bins of 10 degrees, just like in the example above. However, since the bins are plotted at the edges you get the impression that the winds were blowing from a slightly different angle than the data suggests.
Star Strider
Star Strider 2018 年 1 月 1 日
My pleasure.
One option is to simply offset the centres by ±½ the bin width (the ‘±’ depending on how your angles are defined).
See if this does what you want (with the original ‘th_x’ matrix here):
polar((th-5)*pi/180, xr)
This shifts them by -5°, so the centres are lined up with the angles.
Experiment to get the result you want.
Martin
Martin 2018 年 1 月 1 日
Now it looks really good, thank you!
Star Strider
Star Strider 2018 年 1 月 1 日
As always, my pleasure!
(A vote for my Answer would be appreciated!)

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

その他の回答 (1 件)

Magda
Magda 2015 年 3 月 23 日

0 投票

thank you so much!!!!

1 件のコメント

Star Strider
Star Strider 2015 年 3 月 23 日
My pleasure!
That was an interesting challenge!

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

カテゴリ

ヘルプ センター および File ExchangePolar Plots についてさらに検索

質問済み:

2015 年 3 月 23 日

コメント済み:

2018 年 1 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by