how to plot a circle in MATLAB with inner concentric circles?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jamie Al
le 20 Juil 2022
Réponse apportée : Star Strider
le 20 Juil 2022
How can I create this following plot, the black circle showing the Northern polar view with the magnetic local times (MLT) and concentric dashed circles are plotted in 10° interval, with the outermost ring representing 40°.??
2 commentaires
Réponse acceptée
Star Strider
le 20 Juil 2022
Try something like this —
rv = linspace(80, 40, 5);
r = linspace(0, 5, 6);
ac = linspace(0, 2*pi, 500);
xc = r(:)*cos(ac);
yc = r(:)*sin(ac);
al = linspace(0, 2*pi, 5);
xl = max(r)*cos(al);
yl = max(r)*sin(al);
figure
plot(xc.', yc.', '-k')
hold on
plot([-1 1]*max(r), [0 0], '-k')
plot([0 0], [-1 1]*max(r), '-k')
hold off
Ax = gca;
axis('equal')
Ax.Visible = 'off';
text(r(2:end), zeros(size(r(2:end))), compose('%2d',rv), 'Vert','top', 'Horiz','right') % Degrees Latitude
ha = ["left" "center" "right" "center"];
va = ["middle" "bottom" "middle" "top"];
lt = 6:6:24;
for k = 1:4
text(xl(k), yl(k), sprintf('%2d LT',lt(k)), 'Horiz',ha(k), 'Vert',va(k)) % Time Labels
end
% text(-6,4,sprintf('|_____|\n2000 ms'), 'Interpreter','latex') % Scale Bar
Experiment to get the result you want. The scale bar prints, however MATLAB doesn’t like it, so I commented it out.
.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Axes Appearance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!