how to plot a circle in MATLAB with inner concentric circles?

4 ビュー (過去 30 日間)
Jamie Al
Jamie Al 2022 年 7 月 20 日
回答済み: Star Strider 2022 年 7 月 20 日
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 件のコメント
Michael
Michael 2022 年 7 月 20 日
You just want the polar grid?
Jamie Al
Jamie Al 2022 年 7 月 20 日
Yes! and I will add my own data to it.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2022 年 7 月 20 日
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 件)

カテゴリ

Help Center および File ExchangeAxes Appearance についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by