PDA

查看完整版本 : 为什么在MATLAB中绘制的圆显示为椭圆?


poster
2019-12-10, 16:49
我不知道在MATLAB中如何绘制一个圆并正确显示它,而不是默认显示为椭圆。我想这与轴上的局部坐标系有关。


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

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; https://i.stack.imgur.com/FhuoU.jpg (https://i.stack.imgur.com/FhuoU.jpg)



更多&回答... (https://stackoverflow.com/questions/1861339)