문제

I am using the Octave plot function to plat a 2D graph. I want to scale the x axis by 2x (no change to y axis). i.e. the distance between each unit in x axis is doubled.

How do I do that in Octave?

도움이 되었습니까?

해결책

You have to use the parameter "dataaspectratio" of the function "set" to modify the aspect ratio of the plot (as the self explaining parameter name indicates). dataaspectratio accepts a 3-element vector, with the scales for X,Y and Z, so if you want X to be double as the Y axis scale you should use:

set(gca,'dataaspectratio',[2 1 1])
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top