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
 Origin Forum
 Programmatically Place annotation on XY Graph

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
isroashish Posted - 03/18/2020 : 05:35:36 AM
Hello Everyone,
In the XY graph, i want to find max value of y column and place annotation on XY graph Programmatically.
I would be very grateful for your suggestion or LabTalk script.

ASHISH
3   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 03/20/2020 : 2:16:09 PM
Hi,

Please try the script:

range rx = [Book1]Sheet1!col(A);
range ry = [Book1]Sheet1!col(B);
double dy = max(ry);
double dx = table(ry, rx, dy);
string strlbl$ = "(" + text(dx)$ + "," + text(dy)$ + ")";
label -s (%(strlbl$));
text.x= dx + text.dx/2;
text.y= dy - text.dy/2;


Notice here the object name text is hard coded, if the graph already contains text object, you may need to change.

James
isroashish Posted - 03/20/2020 : 05:43:03 AM
Very Very Thanks,

I want to display max value in the form of (x,y).Can you give me hint to replace "max" label to "(x,y)" value, in this case (dx,dy).

I am trying to convert double to string but i am getting syntax error.


ASHISH
YimingChen Posted - 03/18/2020 : 10:57:09 AM
Hi,

Suppose your xy data are saved in Col(A), Col(B) of [Book1]Sheet1. Then activate the graph and run the script below:

range rx = [Book1]Sheet1!col(A);
range ry = [Book1]Sheet1!col(B);
double dy = max(ry);
double dx = table(ry, rx, dy);
label -a dx dy max;


James

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