Author |
Topic  |
|
dcaplan
Canada
Posts |
Posted - 06/02/2005 : 4:48:37 PM
|
Origin Version (Select Help-->About Origin): 7.0 SR4 Operating System: win xp
Hello, I'm using a custom NLSF, and sometimes I am fitting 2 data sets on the same graph, however when I use NLSF.PasteParams("P"); to paste the statistics to the plot, it only gives 1 window when the script completes... I suppose it is the one for the second fit. The function to fit using the custom NLSF is indeed called twice (once for each dataset).. any ideas?
- David
|
|
Leo_Li
China
Posts |
Posted - 06/06/2005 : 08:05:39 AM
|
Your 2 datasets were separatedly fitted? If so, need to call NLSF.PasteParams("P") twice. Once after each fit.
Leo @ OriginLab |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 06/06/2005 : 08:37:24 AM
|
I think David means that the label from the second fit replaces that from the first. (The label name is always FIT.P). You can make a copy of the first label by executing the following prior to the second fit...
GraphLayer gl = Project.ActiveLayer(); GraphObject go = gl.GraphObjects("FIT.P"); if( go.IsValid() ) { string sCmd = go.Text; sCmd.Format("label -s -sa \"%s\"",sCmd); gl.LT_execute(sCmd); }
Mike Buess Origin WebRing Member |
 |
|
dcaplan
Canada
Posts |
Posted - 06/06/2005 : 5:05:35 PM
|
So what exactly does this code do? it looks like it labels the text box FIT.P, which, as you said is the default name... ? It seems to work, but I don't understand how :) How can put the statistics in an actual text box? it looks like the text is just superimposed on the graph. would this be a label parameter?
Thanks! - David |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 06/06/2005 : 8:06:24 PM
|
Hi David,
The NLSF routine names its output text box FIT.P. The code I suggested looks for an object called FIT.P (the text box) and copies its text (parameters from first fit). It then creates a new text box using LabTalk's 'label' command and pastes that text to it. After the next fit NLSF will recreate FIT.P and fill it with the new parameters.
You should end up with two text boxes. Click on the one containing the parameters from the second fit and select Format > Label Control to open the Label Control dialog. In the upper left corner will be a box labelled Object Name with the value FIT.P. The text box containing the first set of parameters will be named something generic like Text or Text2.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 06/06/2005 8:08:11 PM |
 |
|
|
Topic  |
|