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
 Origin Forum
 Measuring distances on a line 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

abasu

USA
1 Posts

Posted - 03/22/2002 :  10:47:53 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Has anyone figured out an easy way to measure
Dx and Dy between two points on a line graph
window?

Laurie

USA
404 Posts

Posted - 03/22/2002 :  12:30:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use the data reader tool to read the (X,Y) coordinate values. Open the Script Window (Window:Script Window) and type the following:
x=
and press Return. The x value will be typed out to the Script Window. Repeat for y (y=).

Move the cursor to a new X,Y value and again return the values to the Script Window.

You can then use the Script Window for simple math.

You could automate this much further...

OriginLab Technical Support
Go to Top of Page

H.Steen

Norway
12 Posts

Posted - 03/24/2002 :  11:19:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can also use the data selector tool to set both left and right point on your graph before you read out the difference.

Place a text label on your graph, Press the (Alt) key while you double click on the label, Change "script run after" to Button up and paste the following code into the script part of the window,

ii=0;
dotool 4;
define PointProc
{ // Insert all commands to perform after dotool here
ii++;
ii1=MKS1;
ii2=MKS2;
Type Marker position:;
ii1=;
ii2=;
Type DeltaX: ;
Data1_A[ii2]-Data1_A[ii1]=;
Type DeltaY: ;
Data1_B[ii2]-Data1_B[ii1]=;
DeltaX=Data1_A[ii2]-Data1_A[ii1];
DeltaY=Data1_B[ii2]-Data1_B[ii1];
if (ii>0)
dotool 0;
}

The PointProc is a little more difficult than ordinary Labtalk code. To get it working the first time I searched the forum for 'PointProc'.

After you press the button you can move the markers with the mouse or the keyboard and when you doubleclick the data are shown in the script window. You can add more code to perform some more calculation using the values of DeltaX and DeltaY.

Helge



Edited by - H.Steen on 03/24/2002 11:22:44
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