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
 paste cells onto graph from labtalk

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
monoprotic Posted - 08/04/2009 : 2:02:13 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR5
Operating System: XP professional

When cells in a worksheet are copied and then pasted onto a graph, a table containing those cells is generated and displayed on the graph. Is there a way to do with in LabTalk scripts? I wish to automatically display some worksheet cells on the graph from a script.

Thanks.
1   L A T E S T    R E P L I E S    (Newest First)
VincentLiu Posted - 08/06/2009 : 04:03:36 AM
Hi,

The following is a simple example to show how to do this. We will first create a table with 2 columns and 3 rows on a graph by using the "add_table_to_graph" x-function. Then copy the values of the 1st column of Sheet1 (from row 3 to row 5) to the 1st column of the new created table. And copy the values of the 2nd column (from row 5 to row 7) to the 2nd column of the table. The following is the steps.

1. Create a new project. Fill the two columns of Sheet1 of Book1 with Row Numbers. Then create a line plot and make the graph activated.

2. Copy the following scripts to Command Window to execute it.

add_table_to_graph cols:=2 rows:=3;  //Create a table

range b1 =[Book1]1!col(1);
range b2 =[Book1]1!col(2);

range a1=[table1]1!col(1);
range a2=[table1]1!col(2);

a1[1]=b1[3]; 
a1[2]=b1[4];
a1[3]=b1[5];

a2[1]=b2[5];
a2[2]=b2[6];
a2[3]=b2[7];

doc -u;   //update the windows

For more details about the "add_table_to_graph" x-function, please refer to


http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Add_table_to_graph

Best regards,
Vincent
OriginLab Tech Services


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