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
 Different labels for a selection of data points
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Clairekun

Germany
175 Posts

Posted - 07/19/2021 :  11:27:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10

Hello,

I wanted to know whether there was a LabTalk equivalent to double-clicking a single data point in a graph to set custom label properties.

I have found how to do this if I wanted all selected data points to look the same, but I seem unable to find anything mentioning the customization of a number of single data points separately.

I need to do this for the same row numbers in all of my graphs, but they don't always have the same x,y values (x values are similar, y values can vary significantly).

Thank you.

YimingChen

1665 Posts

Posted - 07/20/2021 :  4:19:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may get the x,y coordinates of that particular row and use the label command to add label at that position.
https://www.originlab.com/doc/LabTalk/ref/Label-cmd#-a.3B_Place_a_new_label_at_specified_point_in_the_Cartesian_coordinate

James
Go to Top of Page

Clairekun

Germany
175 Posts

Posted - 07/29/2021 :  11:03:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have been trying to do this by myself, but I don't know where to start.

I know how to select the desired plot (if there are several plotted lines), but I have been unable to get the coordinates from there; no Get command seems to do the trick.

I would also like to draw a line from those coordinates down to the beginning of Y axis. If I have understood things correctly, the script for this last part would be:
int coordx = 10;
int coordy = 5000;
int yfrom = layer.y.from;

draw -d 2 -l {coordx,coordy,coordx,yfrom};


Where the values of coordx and coordy would be the coordinates extracted in the first part.

I am sure this is already explained somewhere, but I simply couldn't find where (I might not have been using the right keywords in my search). How can I get the coordinates from a specific index/row in a plot?

EDIT: I got it.

//%(dataplot,@L for x or @V for y, row number)
layer -c; //Count the number of plots in the layer and add that number in the variable named "count"
double lay = count; //Assign a variable name to the plot where the label/dropline will be (in this case, the last one)
double Coordx = %(lay, @L, 125); //Get the X coordinate for the point number 125 in that plot
double Coordy = %(lay, @V, 125); //Get the Y coordinate for the point number 125 in that plot
double yStack = 11000; //If your plots are stacked, type the distance between each plot (only for constant distances)
double Totaly = (lay-1)*yStack+Coordy; //Total Y value is the coordinate + stacking space
double yfrom = layer.y.from;
double LabelOffset = 2000; //Label offset so that the text doesn't fall directly on the plot line

draw -d 2 -l {Coordx,Totaly,Coordx,yfrom}; //Draw a dashed line

label -n Pointlabel Text; //Create a label named Pointlabel with the message "Text"
Pointlabel.x = Coordx; //Place the label in the right coordinates.
Pointlabel.y = Totaly+LabelOffset;


Edited by - Clairekun on 07/29/2021 12:39:33 PM
Go to Top of Page

yuvsaha123

2 Posts

Posted - 08/28/2021 :  10:47:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks for the awesome information.
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