plot a marker in the center of the circle?

5 ビュー (過去 30 日間)
Nicholas Deosaran
Nicholas Deosaran 2020 年 9 月 24 日
回答済み: Star Strider 2020 年 9 月 24 日
Hello all I have my code below and would like to know,
how can I edit it that it will always put a marker in the center of the circle each time and for multiple cicles
function circle = circleplot(x,y,r,c)
hold on
th = 0:pi/50:2*pi;
x_circle = r * cos(th) + x;
y_circle = r * sin(th) + y;
circle = plot(x_circle, y_circle);
fill(x_circle, y_circle, c)
axis equal
end
Thank you

採用された回答

Star Strider
Star Strider 2020 年 9 月 24 日
Add this after the fill call:
plot(x, y, 'kp', 'MarkerSize',15, 'MarkerFaceColor','k')
Also consider separate arguments for the marker colour and size.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Translated by