| Author |
Topic  |
|
|
Thomas M
Germany
Posts |
Posted - 05/03/2005 : 10:31:04 AM
|
EDIT: Sorry, wrong forum! it should be in the LabTalk Forum. Can somebody move it, or maybe somebody knows an answer at all. A LabTalk-solution would be highly prefered!
Origin Version (Select Help-->About Origin): 6.0 Operating System: w 98
Hi, I'm searching for a more elegant way to plot my data. I've a worksheet with 12 columns (xyxyxyxyxyxy) and I want to plot it into a template with 6 layers. The following script works but is quite complicated:
win -t plot c:\2x3 %P_graph; %R=%H;
lay -s 1; lay -i %Q_B; lay -a; legend; lay -s 2; lay -i %Q_D; lay -a; legend; lay -s 3; lay -i %Q_F; lay -a; legend; lay -s 4; lay -i %Q_H; lay -a; legend; lay -s 5; lay -i %Q_J; lay -a; legend; lay -s 6; lay -i %Q_L; lay -a; legend;
with %Q containing the name of the worksheet with the data to be plotted. But what if i want to expand it to a worksheet with, lets say, 100 colomns. I don't want to plot them this way! So I've tried the following
win -t plot c:\2x3 %P_graph; %R=%H;
loop(i,1,6) { lay -s $(i); //till here, everything works k=i*2; //these two lines are my problem lay -i %Q_$(k); //these two lines are my problem lay -a; //from here, everything works again legend; };
How can i tell him to take every second row from %Q and plot it into a new layer?
Thank you,
Thomas
Edited by - Thomas M on 05/03/2005 10:36:28 AM |
|
|
Mike Buess
USA
3037 Posts |
Posted - 05/03/2005 : 10:45:44 AM
|
Hi Thomas,
First of all, are you sure you want 100 layers in the same graph? Aside from that, the %Q_%A syntax for naming a dataset requires that %A is the column name, not column number. Try this instead...
loop(i,1,6) { lay -s $(i); k=i*2; lay -i %(%Q,k); lay -a; legend; };
Mike Buess Origin WebRing Member |
 |
|
|
Thomas M
Germany
Posts |
Posted - 05/04/2005 : 03:49:52 AM
|
No, definetly not in one graph. Might be a little bit confusing. :) But a more elegant way with a shorter script is allways prefered to me.
Thanks, it works well! |
 |
|
| |
Topic  |
|
|
|