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
 3 Layers Graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Ketanbhargav

India
1 Posts

Posted - 02/26/2014 :  12:41:24 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi There Guys


Im trying to write a script enabling me to plot three graphs into separate layers from one active wordbook. Also I was asked to think about a script helping to plot several graphs, all from different different workbooks in one single layer. Is there any easy way to express this in Lab Talk?
thanks in advance

Ketan

http://www.indian-astrologer.co.in/

Echo_Chu

China
Posts

Posted - 02/26/2014 :  02:20:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Ketan

To plot graph in different layer of a graph. You can create a desired template and then add the plot to each layer one by one.

Please take the codes below as an example. In the example I used build-in 4 panel template, PAN4. You can specify your customized template.


// Import data file
string fpath$ = "Samples\Import and Export\S15-125-03.dat";
string fname$ = system.path.program$ + fpath$;
impASC;
 
// Remember Book and Sheet names
string bkname$ = page.name$;
string shname$ = layer.name$;
 
// Plot the first and second columns as X and Y in a specified template.
// The worksheet is active, so can just specify column range
plotxy iy:=(1,2) plot:=202 ogl:=[<new template:=PAN4>];
 
// Plot the remaining columns as X and Y into the second layer
// Now that the graph window is the active window, need to specify Book 
//and Sheet;
loop (ii, 3, 4)
{
	// Add dataset into a layer
	plotxy [bkname$]shname$!$(ii) plot:=202 rescale:=1 ogl:=$(ii-1);
}



To plot different workbooks in a single layer, you can also get used to the plotxy function as in above code, but specify the bkname and shname as needed and keep setting "ogl:=1";

Echo
OriginLab Technical Service
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