2009-12-07 144 views

回答

13

可以使用命令axis equal將數據單位設置爲在每個軸上相同。這裏有一個例子:

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; 

enter image description here

5

除了使用axis equal@gnovice建議,您可以通過使用daspect關閉拉伸到填充功能:

daspect manual 

甚至設置軸縱橫比明確地爲:

daspect([1 1 1])