plot a marker in the center of the circle?

12 visualizaciones (últimos 30 días)
Nicholas Deosaran
Nicholas Deosaran el 24 de Sept. de 2020
Respondida: Star Strider el 24 de Sept. de 2020
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

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by