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
 Different labels for a selection of data points

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
Clairekun Posted - 07/19/2021 : 11:27:25 AM
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.
3   L A T E S T    R E P L I E S    (Newest First)
yuvsaha123 Posted - 08/28/2021 : 10:47:40 AM
thanks for the awesome information.
Clairekun Posted - 07/29/2021 : 11:03:22 AM
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;

YimingChen Posted - 07/20/2021 : 4:19:41 PM
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

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