| T O P I C R E V I E W |
| pcvolkmar |
Posted - 08/01/2005 : 08:06:52 AM Origin Version (Select Help-->About Origin): Operating System: win xp now i have change a littel the script: x1=col(J); y1=col(U); x2=col(J); y2=col(L); x3=col(I); y3=col(L); x4=col(L); y4=col(nphot); x5=col(L); y5=col(nlum);
%a=data1; w=20; h=80;
for(i=1;i<=5;i++){ worksheet -s x%i 0 y%i 0; worksheet -p 201 Scatter; layer -i %a; }; but the same result.
|
| 4 L A T E S T R E P L I E S (Newest First) |
| Mike Buess |
Posted - 08/03/2005 : 07:44:23 AM Hi Paula,
quote: I have tried to do what your you have said to me. axisX1=col(J); axisY1=col(U);
You've truncated the colnum() function name. If I understand what you're trying to do then use this...
axisX1=colnum(J); axisY1=colnum(U);
I don't understand what you are trying to accomplish with the layer command. As I said in previous post, 'layer -i Data1_B' will plot col B of Data1 in the active graph layer. 'layer -i Data1' will do nothing as you've observed. What do you want to do at that point? The 'worksheet -p' command will plot the columns selected by 'worksheet -s'. 'layer -i' is needed only if you want to add a plot of a column that is outside of the selection range.
...There are more problems with your script. 1. The colnum() function returns the number of the named column within the active worksheet. If you have five different worksheets you must activate them one at a time to get their column numbers. 2. Your use of %i as a string is wrong. Use win -a Data$(i) instead.
Assuming the named columns exist in each worksheet then this version of your script will create five different graph windows...
win -a Data1; // activate first wks axisX1=colnum(J); axisY1=colnum(U); win -a Data2; // activate second wks axisX2=colnum(J); axisY2=colnum(L); win -a Data3; // activate third wks axisX3=colnum(I); axisY3=colnum(L); win -a Data4; // 4th axisX4=colnum(L); axisY4=colnum(nphot); win -a Data5; // 5th axisX5=colnum(L); axisY5=colnum(nlum);
for(i=1;i<=5;i++) { win -a Data$(i); worksheet -s axisX$(i) 0 axisY$(i) 0; worksheet -p 201 Scatter; };
At this point you gain nothing by plotting in a loop. This is shorter and less complicated...
win -a Data1; worksheet -s colnum(J) 0 colnum(U) 0; worksheet -p 201 Scatter; win -a Data2; worksheet -s colnum(J) 0 colnum(L) 0; worksheet -p 201 Scatter; win -a Data3; worksheet -s colnum(I) 0 colnum(L) 0; worksheet -p 201 Scatter; win -a Data4; worksheet -s colnum(L) 0 colnum(nphot) 0; worksheet -p 201 Scatter; win -a Data5; worksheet -s colnum(L) 0 colnum(nlum) 0; worksheet -p 201 Scatter;
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 08/03/2005 09:06:20 AM |
| pcvolkmar |
Posted - 08/03/2005 : 05:07:08 AM Hi Mike, I have tried to do what your you have said to me. axisX1=col(J); axisY1=col(U); . . . for(i=1;i<=5;i++){ win -a Data%i; worksheet -s axisX%i 0 axisY%i 0; worksheet -p 201 Scatter; layer -i Data%i; };
I don't have any results. The name Data , I use it of correct form? and the commands win and layer?? I try to obtain each graohic in a different window. thank, Paula. |
| pcvolkmar |
Posted - 08/03/2005 : 03:20:26 AM Thanks |
| Mike Buess |
Posted - 08/01/2005 : 10:12:27 AM First... see my point about correct usage of worksheet -s in your previous topic... http://www.originlab.com/forum/topic.asp?TOPIC_ID=4158
Second... to add a plot to an existing layer use layer -i dataset. For example, to plot col(B) in Data1 use this...
layer -i Data1_B;
Third... x1, x2, x3, y1, y2 and y3 are system variables and you should avoid using them for something else in your scripts.
Mike Buess Origin WebRing Member |