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
 Plotting data only in first layer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Poffel1985

Germany
17 Posts

Posted - 11/08/2016 :  07:25:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, i am using the recent version of Origin.

I would like to plot multiple columns into a template
(1. layer:x-y
2. layer: x-axis which is dependent on the first x-axis).

However, when I try this my data is seperated on both layers instead of only the first layer. Could you help me fixing this issue?

My syntax is in this way

wks.colSel(1, 1) ; //x1
wks.colSel(2, 1) ; //y1
wks.colSel(3, 1) ; //x2
wks.colSel(4, 1) ; //y2
wks.colSel(5, 1) ;//x3
wks.colSel(6, 1) ; //y3

worksheet -p 200 SpecialXYX_Template;



Y1 and Y3 would then be in Layer 1 and Y2 in Layer 2

Best regards

Chris D

428 Posts

Posted - 11/08/2016 :  09:57:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Assuming the worksheet you want to plot from is active, this LabTalk will do as you wish:

string str$ = %E;
plotxy plot:=200 iy:=%(str$)!(1,2) ogl:=<new template:=SpecialXYX_Template>;
plotxy plot:=200 iy:=%(str$)!(3,4) ogl:=2!;
plotxy plot:=200 iy:=%(str$)!(5,6) ogl:=1!;


More info about plotxy X-Function is here:
http://www.originlab.com/doc/X-Function/ref/plotxy
http://www.originlab.com/doc/LabTalk/examples/Plotting

Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 11/08/2016 :  3:24:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

In addition to Chris' "right" approach, if you to make a "retrofit" code to your current code, you can simply add:

  layer -j;
to extract all plots in separate layers. Then, you can link the layers such as by:

  layer2.link=1;
  layer2.X.link=0;
Hope this also helps you.

--Hideo
Go to Top of Page

gzforever

Poland
14 Posts

Posted - 11/09/2016 :  8:22:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
To draw the plot in a specific layer u can use :

ogl:=[Graphname]1!;

Number indicates the number of layer.

In my example where i am plotting data on the first layer of graph named "Al spectro" :

plotxy iy:=2 plot:=201 color:=ii+1 ogl:=[Al spectro]1!;

Kind regards,
JZ
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