plotting concentric circles using contour

12 次查看(过去 30 天)
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)

采纳的回答

Star Strider
Star Strider 2020-10-26
Use the axis function, specifically either:
axis('equal') % Function Expression
or:
axis equal % Command Expression
.
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by