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
 Change label text in legend from labtalk?

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
tom3m Posted - 05/22/2002 : 4:50:37 PM
How do I change the label text in a legend directly from labtalk? For each column pair to be plotted, I wish to construct a legend string using a subset of text from the first entry in each column (a text entry) rather from the column name. For example, I extract current density Jval and x,y color coordinates xval, yval for the column pair and want to make a legend string that says something like

"Current Density = $(Jval) mA/cm\+(2), x = $(xval),y = $(yval)"

Is there an object method for doing this? I have tried making my own legend using the label command, eg

label -sa -j 0 \L(1) str1 \r\n \L(2) str2;

where str1 and str2 are the new strings as constructed above, but this doesn't quite line up as well as legend.

Any ideas? I'm running Oring 6.1 right now. Thanks!
2   L A T E S T    R E P L I E S    (Newest First)
tom3m Posted - 05/23/2002 : 09:10:14 AM
Thanks Mike. The legend object is not documented very well for us newbies. I also found a link on the Origin forum (not labtalk - silly me for not searching everywhere) that shows how to make legends with long strings.

Another way that I found to be even easier is to just put the string in the column label before making the legend. You know, something like (for column number ii):

%z = mystring;
mysheet!wks.col$(ii).label$ = %z;

I don't know why I didn't start using column labels earlier to do this. It is easier to give each column a descriptive label than trying to deal with the 11 character column name limit.

Sorry, but for some reason when I posted this topic it got posted twice. I really don't know how it happened.

Cheers!
Mike Buess Posted - 05/22/2002 : 9:07:10 PM
The legend is merely a text object named "legend". You can access its contents with

%S=legend.text$;

Similarly, you can set its contents with

legend.text$=%S;

where the string variable %S can be anything you want. I'm not sure if you can use escape characters (\n, \r, etc.), by you always use the method I suggested in the Simple MessageBox topic to create multiple lines of text.


Mike Buess
Origin WebRing Member

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