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
 how can I remove some entries of legend?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

akuhr

Germany
9 Posts

Posted - 02/17/2019 :  2:57:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2019 at Windows 7

Hello!

With LabTalk I plot 10 lines to a Layer. But
in the legend I only want to appear line 1-5 and
not line 6-10.
Can I realized this with LabTalk?

Regards, Astrid

yuki_wu

896 Posts

Posted - 02/17/2019 :  10:44:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Astrid,

You could specify the lagend text via:
legend.text$ =

For example:
string str$ = \l(1) %(1Y, @L) \l(2) %(2Y, @L);
legend.text$ = str$;


More info about legend substitution notation:
https://www.originlab.com/doc/LabTalk/ref/Legend-Substitution-Notation

Regards,
Yuki
OriginLab
Go to Top of Page

akuhr

Germany
9 Posts

Posted - 02/18/2019 :  12:14:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Yuki,

thanx for information.
I have a loop over the
first half of data for
plotting it, and this
I want to go to legend.

Then I have a loop over
the second half of data, which
should be not appear in legend.

string mystring$ = \l(1) %(1);
for (ii = 2; ii <= ianz/2; ii++) {
        window -a %(Book$);
        page.active = $(ii);	
        wks.colSel(3,3);
        window -a %(Graph$);
        worksheet -P 245 MyTernaryLine;
        icolo = $(ii) + 1;
        layer.plot = $(ii);
        set %C -c $(icolo);
        #type "sheet $(ii) color $(icolo)";
        mystring$ = mystring$ + "\l($(ii)) %($(ii))";
}
# second loop, whithout concating mystring$
legend.text$ = mystring$;
type "%(legend.text$)";

But it is doing all in one line.

\l(1) tab1\l(2) tab2\l(3) tab3\l(4) tab4

How can I get one at under of the other?

(I am a beginner user of Labtalk.)

Regards, Astrid
Go to Top of Page

yuki_wu

896 Posts

Posted - 02/18/2019 :  9:30:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Astrid,

%(CR) means newline in LabTalk. So you could use:

string str$ = \l(1) %(1Y, @L)%(CR)\l(2) %(2Y, @L);
legend.text$ = str$;


Regards,
Yuki
OriginLab
Go to Top of Page

akuhr

Germany
9 Posts

Posted - 02/19/2019 :  06:19:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Yuki,

thanx.
It works very well.

Regards, Astrid

Edited by - akuhr on 02/19/2019 06:22:55 AM
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