質問

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