create _line -M 3;set _line -l 1;
This creates a new dataset named _line and its associated X dataset _line_A, with 3 rows. Then sets its line connection type to 'line'.
def EndToolbox (;undo %C;%C --O _Line;del _line;rescale);
This defines a special macro, 'EndToolbox', that is to be run AFTER you select the two points that determine your substracting line in the next step. Inside this macro you find four commands:
1. Creates a backup of the current dataset so you can 'undo' later if you want.
2. Substracts your _line dataset from your currently selected data (%C).
3. Deletes the _line dataset.
4. Rescales the graph to show all data.
GetPts -n _line 2
[Double-click to set straight line begin..]
[Double-click to set straight line end..];
This asks you to select two XY points in the graph that are going to be kept in the _line dataset. The Screen Reader tool is activated to allow you to do it. After you do that, the Screen Reader tool is de-selected and the 'EndToolbox' macro is triggered, making the substraction.
The substraction in step 2 above is done with interpolation inside and outside (-O) the range you have selected, so your two selected points are enough to define a straight line to do that operation.
Jose Via, Origin WebRing member