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
 Table delete
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kdsaransh

India
89 Posts

Posted - 01/23/2015 :  02:23:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

Is there a way to delete the table from the graph which is created due to fitting.

I searched wiki, but couldn't found the answer.

thanks,

jasonzhao

China
262 Posts

Posted - 01/26/2015 :  02:17:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please open the linear fit dialog,
uncheck Paste Results Table to Sourse Graph , then save the dialog as a theme, such as "myFitLR", then, using this command in your script:

xop execute:=init classname:=FitLinear iotrgui:=lrGUI theme:=myFitLR; 


Best regards,
Jason Zhao
OriginLab Tech Service

Edited by - jasonzhao on 01/29/2015 03:30:44 AM
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 01/26/2015 :  2:16:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Perfect. Thanks .

Further i also want to delete the tables that are created after the fitting in the form of workbook.

I am using "del table1" to delete the table , but i cannot. If i have to delete multiple tables, then how can i use the loop for doing so.

thanks again.
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 01/26/2015 :  9:28:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

This can be done in a similar way:
Please open the linear fit dialog,
uncheck unwanted table group, such as Fit Statistics, then save the dialog as a theme, using the above command in script.


Best regards,
Jason Zhao
OriginLab Tech Service
Go to Top of Page

kdsaransh

India
89 Posts

Posted - 01/28/2015 :  01:51:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ,
Many Thanks.

I had saved the theme as you said, but the table in the workbook area is still there. Am i doing something wrong...?

for(int ii = 2; ii<=n+1; ii++)
{
range rWa = [book1]sheet1!; // Define a worksheet object range
rWa.colSel(ii-1,0); // deselect col 2.
rWa.colSel(ii,1); // select column 2. 1 stands for select. If 0 stands for deselect.
plotxy iy:= [book1]Sheet1!(1,$(ii)) ogl:=[<new template:="
C:\Users\babia\Documents\OriginLab\91\User Files\ac_nonfitting.otp" name:=samplegraph>];
// renames the graph name to worksheet comment name.

page.label$ = %(1,@LC);
layer -a;

layer.x.from = 60; //Set the end value
layer.x.to = 900000; //Set the increment value
//layer.x.inc = 2;

StartRange=70;
EndRange=30000;
mks1=xindex(StartRange,%C);
mks2=xindex(EndRange,%C);

// code for linear fitting
tree lrGUI;
xop execute:=init classname:=FitLinear iotrgui:=lrGUI;

lrGUI.GUI.Fit.ApparentFit = 1;

// remove the fitted table from the graph.
lrgui.GUI.Output.PlotSettings.PasteResultTable.ThemeRsltTable$="myfitlr_notable.INI";

set %c -c 4; //Change the line's color
set %c -d 1; //Change the line's style

xop execute:=run iotrgui:=lrGUI otrresult:=lrOut;
xop execute:=report iotrgui:=lrGUI;

xop execute:=cleanup;

window -a book1;
newsheet name:=result$(ii-1);

col(A)[1]=lrOut.Summary.R1.Intercept_Value;
col(B)[1]=lrOut.Summary.R1.Slope_Value;
}
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 01/29/2015 :  03:34:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Sorry for that method is not working. Let's check the settings you want to apply.

1. Uncheck 'Paste Results Table to Sourse Graph'
2. Check 'Apparent Fit'
3. Uncheck 'Fit Statistics' group

See the graph below:

we save the theme as 'myFitLR' for further use; then run the script below:



// GUI tree for linear fit
tree lrGUI;  
xop execute:=init classname:=FitLinear iotrgui:=lrGUI theme:=myFitLR;
//Specify all data plots on graph to be input data in the GUI tree
ii = 1;
doc -e d
{
	%A =  xof(%C);
	lrGUI.GUI.InputData.Range$(ii).X$ = %A;
	lrGUI.GUI.InputData.Range$(ii).Y$ = %C;
	setplotuid lrGUI ii; //set plot id to lrgui. pl
	ii = ii + 1;	
}

xop execute:=run iotrgui:=lrGUI otrresult:=lrOut;
xop execute:=report iotrgui:=lrGUI;
// clean up linear fit operation objects after fitting
xop execute:=cleanup; 


Best regards,
Jason Zhao
OriginLab Tech Service

Edited by - jasonzhao on 01/29/2015 03:37:36 AM
Go to Top of Page

DonnaKenneth

USA
1 Posts

Posted - 02/13/2015 :  05:03:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks jasonzhao for sharing this post and informative graph in this thread.It is helpful.


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