T O P I C R E V I E W |
scs_emi |
Posted - 07/15/2015 : 07:39:50 AM Hi there
I have to maintain an old program that uses a LabTalk script to draw some charts. This script does not run correctly. Since I am a total beginner with Origin Labtalk I have the following question: My code opens 2 data-sources and is supposed to draw the data into 1 graph. When I execute my code it opens an empty graph without data. ___________________________________________________________________
%A=C:\A_Grid#2a.dat; %B=C:\A_Grid#2b.dat; xn= 41; ... window -a Data1; for (i=1;i<=xn;i+=1) { worksheet -t $(i*2-1) 4; worksheet -n $(i*2) B$(i); worksheet -n $(i*2-1) A$(i); } window -i; window -a Data2; for (i=1;i<=yn;i+=1) { worksheet -t $(i*2-1) 4; worksheet -n $(i*2) B$(i); worksheet -n $(i*2-1) A$(i); } window -i; window -a Plot; for (i=1;i<=xn;i+=1) { %k=Data1_B$(i); set %k -x Data1_A$(i); // without these lines it works but Why? layer -i %k; }
for (i=1;i<=yn;i+=1) { %k=Data2_B$(i); set %k -x Data2_A$(i); // without these lines it works but Why? layer -i %k; }
___________________________________________________________________
When I leave out the following lines, it works.
set %k -x Data1_A$(i);
set %k -x Data2_A$(i);
Does anybody know
- what this line is supposed to do? - What the set-command is? - What -x means ?
Thanks for your help.
itelly
|
1 L A T E S T R E P L I E S (Newest First) |
cdrozdowski111 |
Posted - 07/15/2015 : 12:27:37 PM itelly,
Here is the documentation on the command:
http://www.originlab.com/doc/Labtalk/Ref/Set-cmd#-x_value.3B_Associate_an_X_dataset_with_a_Y_dataset
Those lines of code are attempting to change the associated X column for each of the Y columns plotted in the graph. But if it works correctly without those 2 lines, then just comment them out. |
|
|