How do I create a polar plot with concentric colored rings corresponding to single values?
6 ビュー (過去 30 日間)
古いコメントを表示
I am trying to create a plot that looks like this with rings of constant values (colors) extending from 0 to 100 in 10 unit increments.

However, my code is not producing this, and I do not know where it has gone wrong.
% values representing the colors that each ring should be, starting from the center and moving outwards in 10 unit increments.
values = [364,358,354,348,339,335,330,325,320,310];
xCoord = linspace(0,2*pi,10);
yCoord = linspace(0,100,10);
[TH,R] = meshgrid(xCoord,yCoord);
[X,Y] = pol2cart(TH,R);
[Z] = meshgrid(values);
contour_ticks = 300:5:375;
figure
hold on
contourf(X,Y,Z,contour_ticks);
a=gca;
cb=colorbar;
colormap('jet');
caxis([300 375]);
This produces a plot resembling this:

Any ideas what I'm doing wrong? Any help is greatly appreciated. Thanks.
2 件のコメント
Walter Roberson
2015 年 10 月 6 日
Please clarify the difference between this question and your earlier question http://uk.mathworks.com/matlabcentral/answers/246931-how-do-i-create-circular-patches-within-two-radii . I have no desire to waste my time answering two apparently different questions that might turn out to be the same question.
採用された回答
Walter Roberson
2015 年 10 月 7 日
contourf(X,Y,Z',contour_ticks,'edgecolor','none');
Note: with your code as-is you are going to end up with a white dividing line at the origin. Your circle is not completely closed; I have not checked out why not.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!