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
 Forum for Origin C
 multiple NLSF statistics on the same graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dcaplan

Canada
Posts

Posted - 06/02/2005 :  4:48:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your 2 datasets were separatedly fitted? If so, need to call NLSF.PasteParams("P") twice. Once after each fit.

Leo @ OriginLab
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/06/2005 :  08:37:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

dcaplan

Canada
Posts

Posted - 06/06/2005 :  5:05:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/06/2005 :  8:06:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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