سؤال

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