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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 plotting with a loop

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Thomas M 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
2   L A T E S T    R E P L I E S    (Newest First)
Thomas M 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!
Mike Buess 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000