Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
nanomech
Posted - 08/21/2002 : 08:21:52 AM Hello everybody
I was looking for a function to rescale the x and y-axes so that the scale of the 2 are the same and that the y-axis is not enhanced (for instance if the x-axis is scaled from -10 to 10 and the y-axis from -2 to 2, that the units on the 2 axes are the same). Is there an easy way in Origin where this can be accomplished?
Thank you in advance.
1 L A T E S T R E P L I E S (Newest First)
greg
Posted - 09/06/2002 : 2:01:47 PM Here's a script that does the trick (with //comments):
dx=x2-x1; // find the size of x scale dy=y2-y1; // find the size of y scale temp=layer.unit; // remember current layer units layer.unit=2; // change to inches if(dx>dy) { layer.height=layer.height*dy/dx; } else { layer.width=layer.width*dx/dy; } layer.unit=temp; // restore original layer units
You could also include this script which centers the newly sized layer:
temp=layer.unit; // remember current layer units layer.unit=2; // change to inches layer.top=.5*(page.height/page.resy-layer.height); layer.left=.5*(page.width/page.resx-layer.width); layer.unit=temp; // restore original layer units