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
 Label postion bug?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zimplant

7 Posts

Posted - 11/03/2011 :  09:10:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1 SR2
Operating System: Win 7 64bit

Hi,
I figured some problem adjusting the position of a label to my graph. I made a little script to do some evaluation of the plot and then post it as a label to the graph (see code attached). I added a new button and interestingly I get two different positions when I execute the script ones and after it a second time. My label position is calculated from the system coordinates X1, X2, Y1 and Y2. Im drawing two lines too, but without any problems. I added two figures to show my observation. In the pictures you can see that the coordinates are the same (marked with circles) for the two executions, but the calculated position differs from each other. What I am doing wrong here? Any comments or help will be appreciated.
Wilhelm


draw -n DVL -l  {(X1+(X2-X1)*0.8),(Y1-(Y2-Y1)*0.46),(X1+(X2-X1)*0.8),(Y1-(Y2-Y1)*0.7)};
draw -n DVL2 -l  {(X1+(X2-X1)*0.2),(Y1-(Y2-Y1)*0.46),(X1+(X2-X1)*0.2),(Y1-(Y2-Y1)*0.7)};
MyVar2 =%J-%L;
label -j 0 -s -sa -n MyL1

TM\t30C\t5C\tDelta T [mV]
%(TM2$)\t%J\t%L\t$(MyVar2)
\t%K\t%M;
X1=;
X2=;
Y1=;
Y2=;
MyL1.x = X1 + (X2 - X1) *0.51;
MyL1.y = Y1 - (Y2 - Y1) *0.55;
MyL1.fsize=16;
MyL1.x=;
MyL1.y=;

Sam Fang

293 Posts

Posted - 11/07/2011 :  04:56:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The difference may be caused by the script:
------------------------
MyL1.fsize=16;

------------------------

When the text's font size is changed, size of the text's rectangle may be adjusted to fit the text. So the first execution's MyL1.x or MyL1.y will be adjusted if the default font size is not 16. And the font size is 16 before the second execution, its value will be not adjusted in the second execution.

Sam
OriginLab Technical Services
Go to Top of Page

zimplant

7 Posts

Posted - 12/13/2011 :  09:25:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot for the help.
Didn't think of that.

Wilhelm
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