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
 Matching of first and last point
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cougar2

Germany
Posts

Posted - 06/08/2004 :  05:12:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everyone,

my script plots 45 graphs into 45 layers of one plot. To do this, I calculate the start and stop value for the first graph, then translate all worksheets so that the plots have the same starting point. Next, I plot every single graph and then merge them into one. Last, I rescale every layer, so that there is 10 % space to the axes, vertically.
Now, sometimes the plot heights change (due to my measurement). How can I do the rescaling so that for each graph, the first and last point exactly match in the merged plot?



first=0;last1=0;last=0;
doc -e W {
%A = %H;
if(exist(%A_C)==1) {
first=%A!cell(1,3); // calculate first and last value
last=%A!cell($(wks.maxRows),3)
};
break;
};

doc -e W {kk=$(first)-%H_C[1];%H_C=%H_C+$(kk)}; // translate y-values

doc -e W { // plot every single graph
%C = %H;
worksheet -s 3 0;
worksheet -p 200 kaptemplate3;
};

label -s -d 500 300 -n filename %C;
%t=%C;
win -m; // merge all graphs
diff=($(last)-$(first))/10; // 10 % of Trace difference
doc -e L { // scale all Layers
layer.Y.from=$(first)-$(diff);
layer.Y.to=$(last)+$(diff);
};
layer1.Y.ticks=1;
layer1.Y2.ticks=1;


Regards,
Cougar

  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