How to align X and Y axis to middle of plot?

t = 0:5:360;
x = 10+cosd(t);
y = 10+sind(t);
plot(x,y);
How do I align the x and y axis to the centre of the plot similar to this attached image.

Respuestas (1)

t = 0:5:360;
x = cosd(t);
y = sind(t);
p = plot(x,y);
p.Parent.XAxisLocation = "origin";
p.Parent.YAxisLocation ="origin";

1 comentario

what if data is not centred on 0,0
t = 0:5:360;
x = 10+cosd(t);
y = 10+sind(t);
plot(x,y);

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2022a

Preguntada:

el 28 de Abr. de 2023

Editada:

el 28 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by