Create a plot of points on a circumference separated by radii
Afficher commentaires plus anciens
Hello. I need some help for realizing a plot.
Have you any idea about how to plot a circumference with points and radii as the one in this image?

Réponses (1)
Dyuman Joshi
le 31 Mai 2023
Déplacé(e) : Matt J
le 31 Mai 2023
1 vote
What have you attempted yet?
5 commentaires
Lorenzo Lellini
le 31 Mai 2023
That seems quite complicated.
Here's a simplified approach -
%Number of points
n=5;
%Range of angles
theta = 0:30:360;
%Range of radii
r = 0:n-1;
%Generating the set of points
[R,THETA]=meshgrid(r, theta);
%plotting the points
polarscatter(deg2rad(THETA), R, [], [0 0 0], 'filled')
%Modify ticks and tick labels as per requirement
thetaticks(15:30:360)
rticklabels([])
Dyuman Joshi
le 1 Juin 2023
Modifié(e) : Dyuman Joshi
le 3 Juin 2023
@Dyuman Joshi - this seems almost spot on. But you might change the circumferential ticks, to leave each point appear to be inside a region, not on an edge.
%Number of points
n=5;
%Range of angles
theta = 0:30:360;
%Range of radii
r = 0:n-1;
%Generating the set of points
[R,THETA]=meshgrid(r, theta);
%plotting the points
polarscatter(deg2rad(THETA), R, [], [0 0 0], 'filled')
%Modify ticks and tick labels as per requirement
thetaticks(15:30:360)
rticks([1/2:n-1/2]) % Different
I changed only the very last line from what you did.
Dyuman Joshi
le 3 Juin 2023
Modifié(e) : Dyuman Joshi
le 3 Juin 2023
@John D'Errico, You are, of course, right that my answer is a bit incomplete.
The thing is, I was not sure if I wanted to do give the full solution and thought OP will figure it out based on my comments, so I left some bits.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

