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
 Loop Structure for creating diagrams

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
JoeGo87 Posted - 05/29/2019 : 05:21:46 AM
Origin 2019 (64-bit)
9.6.0.172 (Behörde)
Copyright © 1991-2018 OriginLab Corporation

Hello everybody,

I am learning at the moment how to program simple scripts with LabTalk in Origin 2019. My aim at the moment is, to create a row of different line-diagrams with 2 column-datasets in it. The first column should be fixed, the second column should go from col(83) col(end). In each created diagram, the x-values should be rotated 45° and the x-unit should be deleted. The Y-Units should be changed to the text that is the columns unit.

I created the following loop for this, but there is an error when I execute it:

loop (ii, 83, 108) {plotxy iy:=((1,2),(1,$(ii))) plot:=200
layer.x.label.rotate=45
xb.text$ = ""
yl.text$ = %(?Y, @LU);};


If I only execute the first line:
loop (ii, 83, 108) {plotxy iy:=((1,2),(1,$(ii)) plot:=200);};


i get the following error:

plotxy:X-Function failed to execute!
Bad argument, iy:=
((1,2),(1,83) plot:=200)
#Command Error!



Can someone help me here? I know this is probably a simple question, but as I said, I am an absolute beginner.

THank you!
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 05/29/2019 : 11:38:07 PM
Hi,

You put the bracket at a wrong position. It should be:
plotxy iy:=((1,2),(1,$(ii))) plot:=200;


However, even though we correct the bracket position, the script:
loop (ii, 83, 108) { plotxy iy:=((1,2),(1,$(ii))) plot:=200};

means to loop over from 83 to 108 to plot col(1) & col(2) and col(1) & col(i) as a line plot

This might not you want. You could take a look at this page to find more info about how to define the input range:
https://www.originlab.com/doc/X-Function/ref/plotxy

Regards,
Yuki

OriginLab

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