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
 statistics over multiple plots from a graph window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

schneide

Germany
47 Posts

Posted - 03/06/2018 :  03:17:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.2018 and Service Release (Select Help-->About Origin): b9.5.0.193
Operating System: win7

I have a graph window with multiple plots (xy-datasets) in one layer.
I would like to programmatically retrieve statistical values such as min, max over all plots combined.

I can do this manually by the menu-GUI "statistics on columns"
by selecting
- input data: "combined as single data set" and
- DataRange: by clicking on the plot

I do not manage to do this programmatically, esp.:
-How do I retrieve a range that contains all plots in the graph?
-How do I perform statistics over all plots from this range combined?


By the way is there a way to find out the code which is executed when I perform a calculation manually by configuring a menu-GUI item?





Giselher

Edited by - schneide on 03/06/2018 03:18:01 AM

yuki_wu

896 Posts

Posted - 03/06/2018 :  10:26:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Giselher,

I think you could try the X-Function: addtool_curve_stats
//Execute XF to create gadget	
addtool_curve_stats;
//Declare LT gadget variable
gadget gg = rect;
//Expand ROI to full range
gg.expand(); 
//Define a tree variable
tree mytr; 
//Output result to the tree variable mytr
gg.getresult(mytr);  
//view the tree variable   
mytr.=;

For more info, please refer to these pages:
https://www.originlab.com/doc/X-Function/ref/addtool_curve_stats
https://www.originlab.com/doc/LabTalk/ref/Gadget-obj

For some X-Functions, there is Generate Script context menu to generate X-Function Script. Let us take the addtool_curve_stats X-Function as an example:
1. Select Gadgets: Statistics: Open dialog from menu
2. Set the options in the dialog as usual
3. Click the triangle button at the upper right corner
4. Select Generate Script from the context menu, then the Script Window will pop up with the script

Hope it helps.

Regards,
Yuki
OriginLab
Go to Top of Page

schneide

Germany
47 Posts

Posted - 03/07/2018 :  06:00:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, this did the job,

All I had to do now was to add

label -rc rect;

at the end to remove unwanted output onto the graph window.
And to process the information in the tree variable.

Thanks,
Giselher

Edited by - schneide on 03/07/2018 07:45:49 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