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
 LabTalk Forum
 Import+plot

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
Beltza Posted - 07/02/2014 : 1:45:04 PM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 9.0.0 SR2
Operating System: Windows 7 Ultimate 64 bit.
Hello. I got started with Labtalk recently and I have some problems. I want to write a script which will import some data and then plot it in the same graph and in the same layer. For this moment I have this sctipt for importing data:
dlgPath;
cd path$;
findFiles ext:=s*.txt;
impASC;

It calls a dialog window where I choose those .txt files I need to plot. Than I need to write another to plot the third and the ninth coloumn of all the books I have imported. I was thinking about using something like
for (ii = 1; ii <= count; ii ++)
{ plotxy iy:=[Bookii](Sheet1)!(3,9) plot:=200;
layer -n
}

and then join all the layers in one, but unfortunately in labtalk it does not work. Could somebody help me with this task, please? Thanks to everybody in advance.
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 07/02/2014 : 2:27:07 PM
First, your script hasn't done anything to set 'count'.
Second, it doesn't make sense ( in Origin terms) to create new graph layers and then somehow get each plot into one layer.

Here, I create the graph window first, then loop over all the names gathered by 'findfiles' (delimited by Carriage Return, Line Feed - CRLF) and add the desired data to the graph layer:

dlgPath;
cd path$;
findFiles ext:=f*.dat;
win -t plot line; // line, scatter, linesymb, etc. e.g. your template
range raGr = !; // Point to the GraphLayer
for (ii = 1; ii <= fname.GetNumTokens(CRLF); ii ++)
{
newbook; // or newsheet
file$ = fname.GetToken(ii,CRLF)$; // Get next filename
impASC file$; // import it
plotxy iy:=(3,9) plot:=200 ogl:=raGr; // add to the plot
}

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