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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Increasing line width for linear fit

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
achu6393 Posted - 07/05/2016 : 08:56:09 AM
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!
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 07/06/2016 : 09:25:13 AM
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
achu6393 Posted - 07/06/2016 : 05:02:13 AM
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!
Hideo Fujii Posted - 07/05/2016 : 11:13:34 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000