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;
|
|
|