The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 axes aspect ratio
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nanomech

Switzerland
3 Posts

Posted - 08/21/2002 :  08:21:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

greg

USA
1378 Posts

Posted - 09/06/2002 :  2:01:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000