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