Matching axes scales

后端 未结 2 1709
被撕碎了的回忆
被撕碎了的回忆 2020-12-11 06:22

I have 3D data plotted using the \'plot3\' function. I would like to constrain the Y and Z axes such that they are equal in scale. The X axis should be automatically scaled

相关标签:
2条回答
  • 2020-12-11 07:01

    Try daspect.

    plot3(5*rand(10,1),10*rand(10,1),rand(10,1))
    
    tmpAspect=daspect();
    daspect(tmpAspect([1 2 2]))
    

    daspect() returns the current aspect ratio as produced by axis 'auto'.

    daspect(tmpAspect([1 2 2])) then enforces that y and z have the same scale.

    0 讨论(0)
  • 2020-12-11 07:09

    How about

    axis equal
    

    or even

    axis tight
    axis equal
    

    both after the plot has been drawn.

    Is this what you mean?

    Type help axis at the Matlab command prompt for more capabilities of the axis function.

    0 讨论(0)
提交回复
热议问题