Question

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?

Was it helpful?

Solution

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])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top