MATLAB Answers

color of marks in polar plot

45 views (last 30 days)
Hassan
Hassan on 30 Apr 2011
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?

Accepted Answer

Matt Fig
Matt Fig on 30 Apr 2011
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 Comments
Hassan
Hassan on 1 May 2011
thanks Matt.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 30 Apr 2011
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 Comments
Hassan
Hassan on 30 Apr 2011
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.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!