使贴片比例适合3D绘图比例

时间:2019-03-23 15:38:42

标签: matlab plot figure aspect-ratio

我正在使用WitoldBużantowicz编写的脚本,如link中所示(具体说来,该函数称为flypath.m

代码基本上根据数据矩阵在特定时间绘制对象(例如导弹)。

但是,由于我的轨迹在以下轴范围内,因此我遇到了问题:

xlim [-30000 0]
ylim [0 300]
zlim [0 10000]

由于ylim相对较低,因此3D图看起来几乎是平坦的,如下所示: enter image description here 我在代码中找到了设置轴的位置,并设置了轴:

xlabel('x [m]');
ylabel('y [m]');
zlabel('z [m]');
if strcmp(pAxis,'on') == 1
   axis on;
   axis square;
   grid on;
else
   axis off;
   axis square;
   grid off;
end;          
lighting phong;
daspect([1 1 1]);
view( pView );
if strcmp(pAnimate,'on') == 1
   drawnow;
end;

当我删除命令daspect([1 1 1])时,它解决了问题,但是对象似乎如下拉伸:

enter image description here

如果有其他方法可以以不同的方式设置轴以保持该比率,那真的很有帮助。

非常感谢您。

0 个答案:

没有答案
相关问题