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
 Hiding specific entities in a 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

sebae

5 Posts

Posted - 07/25/2021 :  09:01:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2021b (64-bit) SR1 9.8.5.204
Operating System: Windows
-------------------------------------------
Is there any way to hide specific a entity or entities?
For example, I have three columns (B, C, D) and lines in the worksheet and all entities appeared in the legend by default. But I want to have only 'B' while keeping all lines are in the plot.

YimingChen

1665 Posts

Posted - 07/27/2021 :  09:36:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you execute legend.text$= in script window, you can check the legend text. Maybe you can set new legend text of only the entries you want.

James
Go to Top of Page

sebae

5 Posts

Posted - 07/29/2021 :  06:49:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

If you execute legend.text$= in script window, you can check the legend text. Maybe you can set new legend text of only the entries you want.

James


----------------------------------------------------------------------
Thanks for the reply.
If I have 10 entities originally but need to remove one, that means I have to add 9 entities manually. Do I understand correctly?
Go to Top of Page

YimingChen

1665 Posts

Posted - 07/29/2021 :  11:34:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please try the sample script to remove the second entry of the legend:

int n = 2;
string strNewLegend$ = legend.text$;
string strRemove$ = strNewLegend.Token(n, CRLF)$;
int s = strNewLegend.Find(strRemove$);
int l = strRemove.len();
strNewLegend.delete(s,l+2);
legend.text$ = %(strNewLegend$);


James
Go to Top of Page

sebae

5 Posts

Posted - 07/30/2021 :  01:41:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Please try the sample script to remove the second entry of the legend:

int n = 2;
string strNewLegend$ = legend.text$;
string strRemove$ = strNewLegend.Token(n, CRLF)$;
int s = strNewLegend.Find(strRemove$);
int l = strRemove.len();
strNewLegend.delete(s,l+2);
legend.text$ = %(strNewLegend$);


James



This works well. Thank you so much!
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