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
 longname of column for graph name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

RSiertsema

Netherlands
8 Posts

Posted - 07/02/2014 :  05:59:31 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;
}


lkb0221

China
497 Posts

Posted - 07/02/2014 :  2:04:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - lkb0221 on 07/02/2014 2:06:35 PM
Go to Top of Page

RSiertsema

Netherlands
8 Posts

Posted - 07/04/2014 :  02:33:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks! It worked perfectly.
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