How to plot circle with text aligned along its circumference

20 次查看(过去 30 天)
Hi,
How to plot a circle at X=0, Y=0 and radius=10, and inculde its radius as text in its circumference.
best
regards
jayant

回答(1 个)

Awais Saeed
Awais Saeed 2021-8-20
centerX = 0;
centerY = 0;
Radius = 10;
viscircles([centerX ,centerY ], Radius ); % it creates a circle with given parameters
text(centerX, Radius,'R = 10') % to add text to your plot
  1 个评论
Awais Saeed
Awais Saeed 2021-8-20
You would have to chage the axes if you want to change position of your text.
xlim([-Radius-3 Radius+3])
ylim([-Radius-3 Radius+3])
text(centerX, Radius+1,'R = 10') % Note it will display text at Y = 11

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by