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
 Increasing line width for linear fit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

achu6393

India
38 Posts

Posted - 07/05/2016 :  08:56:09 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 2015Pro 9.1
Operating System: win7

Hello All,

I am sure this is a simple one. But i am struggling to increase the thickness of the line after doing a linear fit to my scatter graph.



As you can see the red line which is the linear fit is too thin which I would like to increase automatically through labtalk code. Also is it possible to move the table to a different Position using coordinates in labtalk?

Thanks a lot in advance.
-Akki

such coding! much wow!

Hideo Fujii

USA
1582 Posts

Posted - 07/05/2016 :  11:13:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Akki,

I hope the following snippet helps you to code:
////////////////////////////////////////////
//Run the following lines after fitting on the graph
range rr = [%H]1!2;  //2nd plot in current graph window
set rr -w 2000;  //set line thickness
tname$=""; //table name
doc -e G {
  ch5$=Left(%B,5)$;
  if(ch5$=="Table") { //if table is found
    tname$=%B;
    Break;
  }
}
%(tname$).width=2500;  //table width
%(tname$).height=1500; //table height
%(tname$).top=580;    //table top position in pixel
%(tname$).left=1150;  //table left position in pixel
////////////////////////////////////////////


--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 07/05/2016 11:14:42 AM
Go to Top of Page

achu6393

India
38 Posts

Posted - 07/06/2016 :  05:02:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Hideo Fujii

Hi Akki,

I hope the following snippet helps you to code:
////////////////////////////////////////////
//Run the following lines after fitting on the graph
range rr = [%H]1!2;  //2nd plot in current graph window
set rr -w 2000;  //set line thickness
tname$=""; //table name
doc -e G {
  ch5$=Left(%B,5)$;
  if(ch5$=="Table") { //if table is found
    tname$=%B;
    Break;
  }
}
%(tname$).width=2500;  //table width
%(tname$).height=1500; //table height
%(tname$).top=580;    //table top position in pixel
%(tname$).left=1150;  //table left position in pixel
////////////////////////////////////////////

--Hideo Fujii
OriginLab



Your code works perfectly! thanks a lot.. thats exactly what i wanted. A question just for my knowledge because I experience a lot of Problems handling strings. Is it necessary to initize a string variable to a empty string always? like in your code:

tname$=""; //table Name

or is there an Advantage to this?
-Akki


such coding! much wow!
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 07/06/2016 :  09:25:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Akki,

> Is it necessary to initize a string variable to a empty string always? like in your code:
> tname$=""; //table Name

I did so just for the precaution just in case when the current window doesn't have any table
object, and unless initializing the value, the old content from the last time might still remain.
Maybe I should declare the variable to make it "local (or session)" - string tname$=""; rather
than having such undeclared "project" scope.
http://www.originlab.com/doc/LabTalk/guide/Data-Types-and-vars#Scope_of_Variables

I'm sorry for that I'm a lazy programmer (though actually I'm not a "programmer").

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 07/06/2016 09:27:48 AM
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