How do I create a polar plot with concentric colored rings corresponding to single values?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
AMart
am 6 Okt. 2015
Kommentiert: AMart
am 7 Okt. 2015
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 Kommentare
Walter Roberson
am 6 Okt. 2015
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.
Akzeptierte Antwort
Walter Roberson
am 7 Okt. 2015
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!