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 for Programming
 LabTalk Forum
 Link Custom Layer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

annekin

Germany
Posts

Posted - 03/21/2006 :  03:22:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7G / 7.5Pro
Operating System: WinXP

Hi,

I have a problem with linking layers. Lets say I have three layers. In all of these layers I want to display the same curve, but in the first layer the y-axis is scaled to the maximum of the curve and the second and third layer should show different magnifications. When clicking the curve by hand together, I just set up a custom link for these layers where I set Y1 to Y1 of layer1 and divide Y2 by the desired magnification. The x-axis is of course linked one-to-one to layer1.
But there is a problem implementing this procedure in my labtalk script, since I know you cannot set a custom link using labtalk. Another way would be to just seperately set the y-axis of the second and third layer. But then rescaling layer1 will not rescale the other layers.
The third alternative I tried was setting the custom link by hand, where the Y2 is divided by a variable, which is then set to the desired magnification. But this only works when the graph page is first called. Changing the value of the variable will not result in changing the scaling behaviour.

Is there a workaround to this kind of thing or am I at a dead end here?

Best regards,
Anita

Mike Buess

USA
3037 Posts

Posted - 03/21/2006 :  10:12:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Anita,

Create a text label in layer 1, open its Label Control and set Script, Run After: Axes Rescale. Then add the scripts needed to rescale layers 2 and 3. You might want to hide the text label for appearance sake. (Select Edit > Button Edit Mode to edit the label later.) You can create similar text labels in layers 2 and 3 in case you want to rescale from those layers.

Scripts for the layer 1 label might look like this...

// x1, y1, etc refer to layer 1 scales
layer2.x.from = x1; // same x1
layer2.x.to = x2; // same x2
layer2.y.from = y1; // same y1
layer2.y.to = y2/L2Magnify; // divide y2 by magnification variable

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/21/2006 10:37:47 AM
Go to Top of Page

Laurie

USA
404 Posts

Posted - 03/21/2006 :  10:25:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Anita,

If you use the third alternative, setting the custom link by hand and using a variable, you can then later on separately set the y axis scale of the second and third layer, if the variable changes.

For example, if you set the Y Axis Link for layer 2 to Custom as follows: Y1=Y1/VAR and Y2=Y2/VAR. If the value of VAR changes, you'll need to also have your script set Y1 and Y2 as follows: y1=layer1.y.from/var; and y2=layer1.y.to/var;, but if you change the values of layer 1, then layer 2 will update automatically.

Laurie

OriginLab Technical Support
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