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
 Hiding specific entities in a 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
sebae Posted - 07/25/2021 : 09:01:37 AM
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.
4   L A T E S T    R E P L I E S    (Newest First)
sebae Posted - 07/30/2021 : 01:41:52 AM
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!
YimingChen Posted - 07/29/2021 : 11:34:23 AM
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
sebae Posted - 07/29/2021 : 06:49:12 AM
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?
YimingChen Posted - 07/27/2021 : 09:36:06 AM
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

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