Ok, so let's say that your X axis scale is the following:
From = 0
To = 10
And the Y axis scale is the following:
From = 0
To = 5
You then want the following to be true:
10/width == 5/height
Select Format:Layer to open the Plot Details dialog. On the Size/Speed tab, first change the units from the relative units, % of page, to a fixed unit such as inches and then note the width and height. In my case the width is 7.27 inches and the height is 5.84 inches.
Therefore, if I leave the width at 7.27, the height needs to be set to 3.6, which is 5*7.27/10.
Note1: To graphically resize the layer and maintain the aspect ratio, hold down the CTRL key while resizing the layer.
Note2: The width and height and from and to values of the axes are Script Accessible.
layer.width and layer.height return the width and height values, respectively.
layer.x.from and layer.x.to return the from and to values for the X axis.
Likewise, layer.y.from and layer.y.to return from and to values for the Y axis.
The formula for height would then be the following:
height = (layer.y.to - layer.y.from) * layer.width / (layer.x.to - layer.x.from)
Here's a complete script, which you can run from the Script Window. (Select Window:Script Window and copy and paste the following script into the Script Window. Highlight the entire thing and press Enter. Your graph will then automatically resize):
oldunit=layer.unit; //store current layer units
layer.unit=2; //set layer units to inches
xrange=abs(layer.x.to-layer.x.from);
yrange=abs(layer.y.to-layer.y.from);
width=layer.width;
height=layer.height;
if(xrange>yrange)
layer.height=width*yrange/xrange;
else
layer.width=height*xrange/yrange;
layer.unit=oldunit; //return layer units (changing units does not change layer size)[
OriginLab Technical Support