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
 Loop over plots in a graph layer

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
AKazak Posted - 06/10/2022 : 02:23:46 AM
OriginPro 2022b (64-bit) SR1 9.9.5.167
Windows 7 Pro SP1 x64

Greetings!

A graph window has page. A page has layers. Layers have plots and graphic objects.
I know a way to loop over graphic objects (https://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs#Looping_Over_Graphic_Objects).
However I couldn't find a way to loop over plots.

https://www.originlab.com/doc/LabTalk/ref/Layer-obj suggests to use
layer.plot

to get or set the active plot number (index).

How do I get the total number of plots in a layer?
How do I loop over the layer plots and modify their formatting?

Thank you.

---
Andrey
6   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 06/10/2022 : 05:23:58 AM
quote:
Originally posted by minimax

maybe the document is too rough to be precise.

A rough(again...) description is:

loop over graph, it works on plot;
loop over worksheet, it works on dataset (column);
loop over matrix sheet, it works on matrix object.



Thank you.
I agree that the help pages have to be corrected.
Ideally, I want to see an Origin object hierarchy schematics to navigate easily.

---
Andrey
minimax Posted - 06/10/2022 : 04:16:48 AM
maybe the document is too rough to be precise.

A rough(again...) description is:

loop over graph, it works on plot;
loop over worksheet, it works on dataset (column);
loop over matrix sheet, it works on matrix object.
AKazak Posted - 06/10/2022 : 03:52:13 AM
quote:
Originally posted by minimax

https://www.originlab.com/doc/en/LabTalk/ref/Layer-cmd#-c.3B_count_datasets_plotted_in_the_active_layer

layer -c;
count=;




Got it.
I could not find this help page easily.

Related question
Can you also comment on the meaning of the dataset while working with graph. I want to understand the difference between plot and dataset (associated with the plot).
For example, while looping through graphs %C contains the name of the active dataset (not active plot). How do I link plot and dataset toghether?

---
Andrey
minimax Posted - 06/10/2022 : 03:22:22 AM
https://www.originlab.com/doc/en/LabTalk/ref/Layer-cmd#-c.3B_count_datasets_plotted_in_the_active_layer

layer -c;
count=;
AKazak Posted - 06/10/2022 : 03:12:56 AM
quote:
Originally posted by minimax

Basically all looping is in document command.

https://www.originlab.com/doc/labtalk/ref/document-cmd#-e_object_.7Bscript.7D.3B_Execute_the_given_script_for_all_objects

Use set command to modify plot's property.
https://www.originlab.com/doc/Labtalk/Ref/Set-cmd


// set all scatter plots symbol size as 20
document -e dy {
	set %c -z 20;
};




Got it.

How do I get the total number of plots in a layer into a variable?

---
Andrey
minimax Posted - 06/10/2022 : 02:47:32 AM
Basically all looping is in document command.

https://www.originlab.com/doc/labtalk/ref/document-cmd#-e_object_.7Bscript.7D.3B_Execute_the_given_script_for_all_objects

Use set command to modify plot's property.
https://www.originlab.com/doc/Labtalk/Ref/Set-cmd


// set all scatter plots symbol size as 20
document -e dy {
	set %c -z 20;
};

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