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
 Origin Forum
 Hide and show 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

AKazak

Russia
1205 Posts

Posted - 09/03/2020 :  12:21:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2021 (64-bit) Beta 4 9.8.0.138
Windows 7 Pro x64 SP1

Greetings!

How I temporarily hide the legend instead of deleting it and reconstructing it back again?

Thank you.

---
Andrey

cpyang

USA
1406 Posts

Posted - 09/03/2020 :  2:31:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Any object on the graph should have a name, and in the case of legend, the name is typically "legend", so
legend.show=0


To find out about LT code for many toolbar buttons of menu, select by holding Ctrl+SHIFT, and you will find out the legend update button execute the LT
legend -r


CP
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 09/04/2020 :  02:02:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

Any object on the graph should have a name, and in the case of legend, the name is typically "legend", so
legend.show=0


To find out about LT code for many toolbar buttons of menu, select by holding Ctrl+SHIFT, and you will find out the legend update button execute the LT
legend -r


CP



Got it!

How do I call the legend object with a name including whitespace, for example, "Legend 1"?

---
Andrey

Edited by - AKazak on 09/04/2020 02:07:08 AM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 09/04/2020 :  02:55:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The legend of a layer is just a text label object, except
1. its name is "legend"
2. it has enabled substitution level > 0

So to access any text object by name, especially if the name include spaces, use the GObject


gobject aa="legend 1";
aa.show=0;


This also allows the label -r command to delete it

label -r aa;


See also
https://www.originlab.com/doc/LabTalk/ref/Graphic-objs#GObject_Variable_Type

CP

Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 09/04/2020 :  04:09:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

The legend of a layer is just a text label object, except
1. its name is "legend"
2. it has enabled substitution level > 0

So to access any text object by name, especially if the name include spaces, use the GObject


gobject aa="legend 1";
aa.show=0;


This also allows the label -r command to delete it

label -r aa;


See also
https://www.originlab.com/doc/LabTalk/ref/Graphic-objs#GObject_Variable_Type

CP




OK, great!

Also, is there a toolbar icon causing the legend of the corresponding layer show/hide?
A 20-year old thread on the same topic: https://my.originlab.com/forum/topic.asp?TOPIC_ID=1351 suggests that there is one, but cannot find it.

---
Andrey

Edited by - AKazak on 09/04/2020 04:09:30 AM
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 09/28/2020 :  11:33:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please share an update on the topic.

---
Andrey
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 09/29/2020 :  10:48:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We will add a button on the layer Mini Toolbar for this.

CP
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