Polar Scatter Plot using 3 Data Set
9 次查看(过去 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!