plotting concentric circles using contour

29 visualizaciones (últimos 30 días)
Randy Chen
Randy Chen el 26 de Oct. de 2020
Comentada: Star Strider el 27 de Oct. de 2020
I'm trying to plot a few concentric circles with the following codes, but what I get is an ellipse, i don't know why:
[x,y] = meshgrid(-3:0.1:3,-3:0.1:3);
z = x.^2+y.^2;
contour(x,y,z)

Respuesta aceptada

Star Strider
Star Strider el 26 de Oct. de 2020
Use the axis function, specifically either:
axis('equal') % Function Expression
or:
axis equal % Command Expression
.
  5 comentarios
Randy Chen
Randy Chen el 27 de Oct. de 2020
thanks a lot!
Star Strider
Star Strider el 27 de Oct. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by