| Author |
Topic  |
|
|
annekin
Germany
Posts |
Posted - 03/21/2006 : 03:22:47 AM
|
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
|
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 |
 |
|
|
Laurie
USA
404 Posts |
Posted - 03/21/2006 : 10:25:34 AM
|
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 |
 |
|
| |
Topic  |
|
|
|