Polar Scatter Plot using 3 Data Set
5 ビュー (過去 30 日間)
古いコメントを表示
Hello, I am trying to draw a polar chart using 3 data sets. The first data set is the set value, the second data set indicates at which azimuth this value set will be found. Finally, color changes need to be made in the value ranges in the primary value setting. How do I do this?
3 件のコメント
Dyuman Joshi
2023 年 10 月 4 日
編集済み: Dyuman Joshi
2023 年 10 月 4 日
From what I understood - The 4th input to polarscatter() corresponds to the colors of the markers. So you should provide the values (variable a in your case) accordingly.
Check out the Marker Colors sub-section in the Input Arguments section of the documentaion for more info.
採用された回答
Star Strider
2023 年 10 月 4 日
編集済み: Star Strider
2023 年 10 月 4 日
Try this —
th = linspace(0,2*pi,20);
r = rand(1,20);
a=[1:1:20];
sz = 75;
% polarscatter(th,r,sz,a,'filled')
[x,y,z] = pol2cart(th, r, a);
tv = linspace(0, 360, 13);
tv2 = linspace(0, 359, 360);
rc = 1;
figure
scatter3(x,y,z,50,z,'filled')
hold on
plot3((rc*[1;1]*cosd(tv)), (rc*[1;1]*sind(tv)), ([0;20]+rc*ones(size(tv))), ':k')
plot3((rc*[0;1]*cosd(tv)), (rc*[0;1]*sind(tv)), (rc*[1;1]*ones(size(tv))), ':k')
plot3((rc*[0;1]*cosd(tv)), (rc*[0;1]*sind(tv)), (20+rc*[1;1]*ones(size(tv))), ':k')
plot3((rc*cosd(tv2)), (rc*sind(tv2)), (20+rc*[1;1]*ones(size(tv2))), ':k')
plot3((rc*cosd(tv2)), (rc*sind(tv2)), (0+rc*[1;1]*ones(size(tv2))), ':k')
hold off
text((1.15*rc*cosd(tv(1:end-1))), (1.15*rc*sind(tv(1:end-1))), (0+rc*ones(size(tv(1:end-1)))), compose('%3d°',tv(1:end-1)), 'Horiz','center', 'Vert','middle')
set(gca,'Visible',0)
EDIT — (4 Oct 2023 at 15:23)
Tweaked plot grid & tick labels.
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!