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
 Script for multiple plots

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
mloving Posted - 09/19/2011 : 1:40:13 PM
Origin Ver. 8.1 and Service Release (Select Help-->About Origin): ??
Operating System: Windows XP

Hi,
I am trying to create a sript for importing data, doing a few simple opertations and then creating multiple plots.

Through the import wizard I am inputing the lab talk code into the filter option.

So far I have:


col(A1)=col(F)/col(D);
Col(A1)[L]$=Tot1/Io1 [TEY +];

col(B1)=col(G)/col(N);
Col(B1)[L]$=Tot1/Io1 [TEY -];

col(C1)=col(H)/col(D);
Col(C1)[L]$=Tot1/Io1 [TFY +];

col(D1)=col(I)/col(E);
Col(D1)[L]$=Tot1/Io1 [TFY -];

col(E1)=col(a1)-col(b1);
col(E1)[L]$=prelim TEY XMCD;

col(F1)=col(c1)-col(d1);
col(f1)[L]$=prelim TFY XMCD;

plotxy iy:=((3,26),(3,27)) plot:=200;

plotxy iy:=((3,28),(3,29)) plot:=200;

plotxy iy:=(3,30) plot:=200;

plotxy iy:=(3,31) plot:=200;



But this only plots the first graph. How can I change it to plot all 4?

Thanks in advance!

-Melissa
3   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 09/20/2011 : 9:51:41 PM
Hi Melissa,

In Origin 8.1, when you import multiple files, the script will run after all the files are imported. However, in current latest version, Origin 8.5.1, you can specify when to execute the script, after all files imported, or after each file imported. Maybe you can download a demo from this page to have a try. You can refer to this document.

Penn
mloving Posted - 09/20/2011 : 08:32:03 AM
Is this generic for the file being imported - ie is it possible to use this for multiple files being imported at once?

Thanks again,
-Melissa
Penn Posted - 09/20/2011 : 01:20:47 AM
Hi Mellisa,

In your script, for the first time you call plotxy, the active window is the worksheet, into which you import data. However, after the plotxy makes the first graph, which becomes the active window, the second call on plotxy will try to get the data from this graph, of course it will fail. That is why you can only get one graph.

So, if you try to call plotxy again, you need to activate the worksheet again in your script. You can use the window command to activate a window. For example, you can change your script like:

string pageName$ = page.name$;  // get the window name
plotxy iy:=((3,26),(3,27)) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=((3,28),(3,29)) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=(3,30) plot:=200;
win -a %(pageName$);  // activate the window again
plotxy iy:=(3,31) plot:=200;


Penn

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