How do I create a polar plot with concentric colored rings corresponding to single values?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 6 Ott 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.
Risposta accettata
Walter Roberson
il 7 Ott 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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!