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
 longname of column for graph name

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
RSiertsema Posted - 07/02/2014 : 05:59:31 AM
Origin Ver. and Service Release : 8.5.1 SR2
Operating System: win7 pro

Hello Origin!


I am pretty sure it is a simple procedure, but I have been searching for hours to get this to work! I am trying to create graphs in a loop, getting the columns longname as graph window name. The number of columns is variable, so hence the loop.

Plotting is going fine, but getting the column longname as graph window name seems to be a douzy. Can you help me out?

my current script:

win -r %H dTData; //name datasheet

int nplt = 2; // plot every 2nd column
int ncols = wks.ncols;
int nlast = ncols - mod(ncols, nplt);
//from the right to the left
for(int ii = nlast; ii > 0; ii -= nplt)
{
plotxy iy:=($($(ii)-1),$(ii));
win -a dTData;
}


2   L A T E S T    R E P L I E S    (Newest First)
RSiertsema Posted - 07/04/2014 : 02:33:37 AM
Thanks! It worked perfectly.
lkb0221 Posted - 07/02/2014 : 2:04:44 PM
Hi,

You just need to add another win -r inside the loop, for example:

//
...
string str$ = col($(ii))[L]$; // Read the longname of col(ii)
plotxy iy:=($($(ii)-1),$(ii));
window -r %H %(str$); // Rename the graph window
win -a dTData;
...
//

Or, directly specify the new window name in plotxy XF.

Zheng
OriginLab

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