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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 paste cells onto graph from labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

monoprotic

USA
3 Posts

Posted - 08/04/2009 :  2:02:13 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

VincentLiu

China
Posts

Posted - 08/06/2009 :  04:03:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Edited by - VincentLiu on 08/06/2009 04:08:07 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000