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
 Linking Y axes in Double Y axis 2D graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dalee

Ireland
7 Posts

Posted - 08/28/2009 :  4:32:52 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.0.63.988 SR6
Operating System: XP Pro

I have an issue with aligning the y axes in a 2 layer common x, double y plot. While I have the graph plotted without any issues, I am having problems with adjusting the scale of the y axes. The y scale of the data is very different but I want to have the y=0 point on each of the y scales aligned. I have been trying the link options in the layer management tool but if this is the right area to be looking, I cannot find how to do this.
I hope somebody will be able to help with this.
Thanks in advance

easwar

USA
1964 Posts

Posted - 08/28/2009 :  5:22:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It may not be possible to set up a linking formula to achieve this.

So script code such as below could work, which simply gets the from and to y values of the two layers and sets the to value of the 2nd layer such that the zero position matches, it assumes of course zero is present in both ranges.

To use this, first set the From value of your 2nd layer Y axis to a suitable value, then copy these lines to script window, select them all and press Enter to execute.


// Make layer 1 active and get the from and to y values
page.active=1;
yy1=y1; yy2=y2;
// Make layer 2 active and get the from y value
page.active=2;
yy3=y1;
// Compute the new to y value
yy4=yy3+yy3*(yy2-yy1)/yy1;
// Set the new to y value
y2=yy4;


You can then keep changing the from value of 2nd layer and keep running this script again and again till you get a suitable range to cover all of the data in the 2nd layer.

Easwar
OriginLab
Go to Top of Page

dalee

Ireland
7 Posts

Posted - 08/30/2009 :  05:30:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works fine.
Thanks for the help
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