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
 Add dataset to graph by script

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
szailer Posted - 09/16/2009 : 11:59:24 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0
Operating System: XP

I'd like to add different datasets from different worksheets to an existing graph by a script so I do not have to search the datasets in the 'layer contents'.

So I'd like to do something like this:
add to layer1 book1_c100
add to layer1 book2_c100
add to layer1 book3_c100

My data to be plotted is always in the same column so it would speed up my work.

Thanks
2   L A T E S T    R E P L I E S    (Newest First)
szailer Posted - 09/17/2009 : 08:21:49 AM
thanks a lot, very helpful.
in an another topic I also found a command:
Graph1!layer.include(Book1_c)

Tamas Szailer
easwar Posted - 09/16/2009 : 5:10:10 PM
Hi,

You can use code such as below. you may need to apply the free SR6 patch (or patch up to SR6) depending on what your SR is right now...for the code to work.

Easwar
OriginLab


// Point to the graph layer, assuming here it already exists
range rGly = [Graph1]1!;
// Loop over all sheets in all books
doc -e LB {
   // Check to see if workbook, so can leave out matrix books
   if(2 == exist(%h,2))
   {
     // Declare range using column name of c100
     range ry=col(c100);
     // Use plotxy X-function to add plot to specified layer
     plotxy iy:=ry plot:=200 ogl:=rGly;
   }
}
// Can use legend update XF so legend shows data range for example;
win -a Graph1;
legendupdate mode:=dr;

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