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
 labtalk-plotting selected columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vikas2014

India
1 Posts

Posted - 10/17/2014 :  10:48:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.6.0
Operating System: windows 7
hey i am pretty new in labtalk scripting. i have the following stuff:
two worksheets, each in XY format, let me name them "theory" and "experiment".
i do some normalisation for data in Y column in "experiment". so now i have XNorm instead of XY in "experiment". then i have to copy XNorm to CD columns (next to AB) in "theory" worksheet. then i plot XYXNorm together. i would love to put a template also for the outcome plot.

i fail in the stage of plotting. how do we plot selected columns using labtalk scripting?? (i need the flexibility of changing column names whenever i need, in the script i write)

also, how to load the ascii data into worksheet by script?
Thanks in advance.

greg

USA
1378 Posts

Posted - 11/05/2014 :  1:54:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Given A,B,C,D where you want to plot B vs. A and D vs. C, you can use:

plotxy ([Theory]Sheet1!(1,2),[Theory]Sheet1!(3,4)) plot:=201;

Rather than use names, I used columns indexes: 1,2,3,4

But you don't need to copy your data at all since you could also use:
range raT = [Theory]Sheet1!(1,2);
range raE = [Experiment]Sheet1!(1,2);
plotxy ((raT),(raE)) plot:=200;

There are lots of options in the impAsc import X-Function, but at its simplest you can use:
dlgfile gr:=ASCII; // Browse for the file you want to import
newbook; // Create a new book (optional)
impasc; // Import the selected file
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