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
 Problem with Graph legend

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
Skaytex Posted - 02/09/2014 : 10:12:03 AM
Hello i have this graph:




And i want to change legend with labtalk.

Is it possible to change legend with labtalk scripting B with col(L)[1], c with col(L)[2] and... Or add col(L)[1] to Col(B) long name, col(L)[2] to Col(C) long name and ...


KF
3   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 02/12/2014 : 1:14:06 PM
The default programming name of legend is "legend" (You can open programming control dialog to change its name).
So to set the position of the legend, you can use the following commands:

legend.x1 = 10; // Set the upper-left corner node X position be 10 based on layer X axis coordinate.
legend.y1 = 10; // Set the upper-left corner node Y position be 10 based on layer Y axis coordinate.
legend.x = 10; // Set the center of legend be 10 based on layer X axis coordinate.
legend.y = 10; // Set the center of legend be 10 based on layer Y axis coordinate.
legend.left = 1000; // Left location of the legend in pixel.
legend.top = 500; // Top location of the legend in pixel.

It's not that easy to position a legend by LabTalk, especially if the legend is out side the layer range, I have to say.

Zheng
OriginLab
Skaytex Posted - 02/12/2014 : 12:15:17 PM
Ty. I have one more problem, how to change graph legend position with labtalk?

KF
lkb0221 Posted - 02/10/2014 : 09:49:30 AM
Hi,

If you prefer to do this manually (by GUI), you can right click the legend and select "Properties". Replace those %(#) by %(1,@WT,12,#).
This notation reads the col(12) cells. For example:
%(1,@WT,12,1) ==> 0.00155

If you want to finish this by LabTalk, you better copy the legend info to "Comments" column label rows.
//Script Start
loop(ii,1,wks.ncols)
{
wks.col$(ii+1).comment$ = cell(ii,12)$;
}
//Script End

hope this would help.

Zheng
OriginLab

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