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
 How to access regional data range with script

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
fexxor Posted - 03/10/2009 : 07:52:47 AM
Origin 8
I want to use the tool "regional data range" to select a range of data in Layer 2 of a graph, and have a script that uses that range selected to define the fitting range for data plotted in Layer 1.

How can I access the upper and lower x range selected by the regional data range selection tool? I can't find this in the manual.
Thanks!
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 03/10/2009 : 09:45:30 AM
Assuming you have only one dataset in layer 1 or the dataset you are interested in is the active dataset, and that the two layers share the same X dataset, here is one way. Run this script after setting the markers in layer 2:

mrk1=mks1; // This remembers the lower bound market 'mks1'
mrk2=mks2; // This remembers the upper bound market 'mks2'
page.active = 1;
set %C -b mrk1;
set %C -e mrk2;

After you are done fitting in layer 1 you can use the Data menu "Reset to Full Range" or execute:
set %C -b;
set %C -e;

If the X are not shared, then you must convert these indexes to X values and find corresponding X values in the other dataset. xindex finds the X equal to or less than and xindex1 finds the X equal to or greater than.

px1=xof(%C)[mks1];
px2=xof(%C)[mks2];
page.active = 2;
newx1=xindex(px1,%C);
newx2=xindex1(px2,%C);
set %C -b newx1;
set %C -e newx2;

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