MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   为什么在MATLAB中绘制的圆显示为椭圆? (https://www.labfans.com/bbs/showthread.php?t=22971)

poster 2019-12-10 16:49

为什么在MATLAB中绘制的圆显示为椭圆?
 
我不知道在MATLAB中如何绘制一个圆并正确显示它,而不是默认显示为椭圆。我想这与轴上的局部坐标系有关。


回答:
您可以使用命令[URL="https://www.mathworks.com/help/matlab/ref/axis.html"]axis equal[/URL]将每个轴上的数据单位设置为相同。这是一个例子:

theta = linspace(0, 2*pi, 100); subplot(121); % Show the default plot plot(cos(theta), sin(theta)); title('Default axes settings'); subplot(122); % Show a plot with equal data units plot(cos(theta), sin(theta)); title('Equalized tick spacing'); axis equal; [URL="https://i.stack.imgur.com/FhuoU.jpg"][IMG]https://i.stack.imgur.com/FhuoU.jpg[/IMG][/URL]



[url=https://stackoverflow.com/questions/1861339]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 02:22

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.