I am new to OriginLab. The questions I am having are described below.
I am trying to add a right y axis (called y2) onto a normal x-y1 plot.
The each value of y2 is related to the corresponding value of y1. For example, y2(i) = [y1(i) - y1(1)] * 10 where I use "i" to represent the row index in the workbook.
After turning on the right y axis, I tried to use the following script: layer.y2.label.formula$=col(B) * 10.
I don't know how to do [y1(i) - y1(1)] in the script. However, I don't get any label on the right y axis even after using col(B) * 10.
I think I need your help. Any suggestion?
Origin Ver. 8.5.1 and Service Release 2 Operating System: Windows 7
I see a couple of problems: (1) Your statement, layer.y2.label.formula$=col(B)*10, has a variable type mismatch eror. It has a string variable on the left of the assignment operator(=), and a numeric expression on the other. You need to fix that.
(2) About your expression, y1(i)-y1(1), you need to use square brackets to address individual cells; parentheses are used to indicate linear interpolated values.
I don't know if these tips will solve your problem. I suggest you create a new column, select the column, and use the pull-down command, Column:Set Column Values to define your new function, y2. Then add y2 to your plot.
Hi olgpacc,
You can try the following script (assuming that your Y1 data is in column B in Book1):
range rb=[book1]sheet1!col(B);
a0=rb[1];
layer.y2.label.formula$="(x-a0)*10";
I hope this is what you wanted.
--Hideo Fujii
OriginLab