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
 Multi line legend from column label
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MarioNZ

New Zealand
Posts

Posted - 10/09/2006 :  10:08:05 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi All,
I want to get the legend in my graphs to appear in multiple lines rather than in one long line and I also want to use the column label to create the legend automatically.

I tried LabTalk scripts that I found in the archive (http://www.originlab.com/forum/topic.asp?TOPIC_ID=3240):

%A=Line1
Line2
Line3;
wks.col2.label$ = %A;

This results in a legend like this:
--- Line1 (Line2)

and

%A = Line1\r\nLine2\r\nLine3;
wks.col2.label$ = %A;

which leads to a different result:
--- Line1rnLine2rnLine3

I also tried to incorporate the -sa switch of the label command like suggested in another post http://www.originlab.com/forum/topic.asp?TOPIC_ID=3191 but I couldn't get this going with the wks.col2.label$ command.

Any ideas how to solve my problem? What am I doing wrong?
Thanks a lot
Mario

Origin Version: 6.1
Operating System: Win2k

Mike Buess

USA
3037 Posts

Posted - 10/10/2006 :  12:53:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mario,

This will maintain your multiline label in the legend but probably won't justify like you want...

%A=wks.col2.label$; // get column label
legend; // create legend
legend.text$=\l(1) %A; // set legend text

It will produce a legend like this...

--- Line 1
Line 2

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/10/2006 12:54:27 AM

Edited by - Mike Buess on 10/10/2006 09:29:38 AM
Go to Top of Page

MarioNZ

New Zealand
Posts

Posted - 10/10/2006 :  9:20:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike!
Interesting that the line breaks have an effect on the legend when inserted as plain text but not when used together with the %(1) variable... (I was hoping I could still use the "New Legend" button afterwards.)

I might just use your script and insert a \l(0) at the beginning of a new line to get the alignment right and I am done

Cheers
Mario
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