필터 지우기
필터 지우기

Polar Scatter Plot using 3 Data Set

조회 수: 5 (최근 30일)
Alexi
Alexi 2023년 10월 4일
편집: Star Strider 2023년 10월 4일
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
Alexi
Alexi 2023년 10월 4일
But how to add third value ? is this correct ? I added the 3rd value set as an example. How do I adjust the color scale according to the size of the values of the elements of the 3rd value set?
clc;
clear;
th = linspace(0,2*pi,20);
r = rand(1,20);
a=[1:1:20];
sz = 75;
polarscatter(th,r,sz,a,'filled')
Dyuman Joshi
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
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개)

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by