color of marks in polar plot

조회 수: 4 (최근 30일)
Hassan
Hassan 2011년 4월 30일
I want to make a polar plot. I have 16 pair of values and want to show them with markers as their colors changes gradually from pair 1 to pair 16. Could you please help me?

채택된 답변

Matt Fig
Matt Fig 2011년 4월 30일
Walter hit on the only solution that makes sense to me. It is not that bad, for instance:
% Sample Data...
A = linspace(0,2*pi,16);
B = A.^2;
mat = repmat((0:1/15:1).',1,3);
polar(A,B);hold on % If you want a connecting line.
for ii = 16:-1:1
L(ii) = polar(A(ii),B(ii),'o');
hold on
set(L(ii),'markerfacecolor',mat(ii,:),...
'markeredgecolor',mat(ii,:))
end
  댓글 수: 6
Matt Fig
Matt Fig 2011년 5월 1일
The dots are still there, but you wanted to go from black to white. Thus the final few are nearly white and don't show up well. To avoid this you could either change the axis color to introduce contrast, or change the range of the dots' color. For example:
mat = repmat((0:.7/15:.7).',1,3);
which would go from black to grey.
Hassan
Hassan 2011년 5월 1일
thanks Matt.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 4월 30일
polar() the entire vector first. Then "hold on" and iterate through the theta/rho pairs polar()'ing each pair individually with the marker and color that you want for that point.
  댓글 수: 5
Walter Roberson
Walter Roberson 2011년 4월 30일
Well, you could interpolate (calculate) the colors you pass to polar() instead of using color letters.
You could polar() in the lines all at one time, and then you could convert the polar coordinates to cartesian and scatter() in the points, specifying a matrix of colors.
You could polar() in the lines all at one time, and then you could convert the polar coordinates to cartesian and then you could use patch() to draw very thin lines, and use vertex shading in the patch()
Hassan
Hassan 2011년 4월 30일
thanks Wlater. it sounds a bit complicated for me but I think Matt got what you suggested and I'll see if I can use that.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by