Author |
Topic |
|
RSiertsema
Netherlands
8 Posts |
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; }
|
|
lkb0221
China
497 Posts |
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 |
Edited by - lkb0221 on 07/02/2014 2:06:35 PM |
|
|
RSiertsema
Netherlands
8 Posts |
Posted - 07/04/2014 : 02:33:37 AM
|
Thanks! It worked perfectly. |
|
|
|
Topic |
|
|
|