Shift curve in X direction
1. cxt 1 10; // shift the plot 1 to right by 10
2. cxt 1 -10 // sift the plot 1 to the left by 10
3. cxt 1 10 4; // shift the peak of the curve to x=10
Please refer to the page for additional option switches when accessing the x-function from script
Input/Output
XYRange
Input
double
int
Option list:
Output
Shift curve in X direction according to the different modes
// The cxt function can be used to shift the x values of a plotted dataset // New book and import data newbook; path$ = system.path.program$ + "Samples\Signal Processing\TR4MM.DAT"; impasc fname:=path$; // Setup data so each has its own X data page.xlcolname = 0; // Turn off "Spreadsheet Cell Notation" (SCN) wks.col1.type = 1; wks.col = 1; wks.insert(Time1); wks.col = 3; wks.insert(Time2); col(1) = data(.01,38,.01); col(3) = data(.01,38,.01); // These are the ranges for plotting columns 2 vs 1 and 4 vs 3 range r1 = (1,2); range r2 = (3,4); win -t plot line; plotxy r1 plot:=200 ogl:=1; plotxy r2 plot:=200 ogl:=1; set %c -c 2; //set active plot (usually plot 1) color as red win -z; //Maximize window // Pause so we can see the shift between our two curves type -b Our two plots appear to be offset in the X direction. We can use the cxt command to shift one curve.; // Now remove the offset by shifting cxt iy:=r1 val:=-.58;
For the Spreadsheet Cell Notation in the workbook, please see FAQ-849 for more information.
Keywords:correction, translate, translation