X axis synchronization of one or more overlays.
OVERLAYXSYNC(win, maxrange)
win |
- |
Optional. The target window. Defaults to the current window. |
maxrange |
- |
Optional. An integer, set the X range of each overlay to fit all series. Defaults to 1. |
Nothing, the overlays of a window are synchronized based on the X axis.
W1: 1..10;settime(w0, "12:00");sethunits("s");setvunits("V")
W2: 3..0.1..20;settime(w0, "12:00");sethunits("s");setvunits("A")
W3: w1;setsym(14);overlay(w2);focus(2);scales(13);focus(1);
W4: w1;setsym(14);overlay(w2);focus(2);scales(13);overlayxsync();
The series in W1 starts at 1.0 and contains 10 samples.
The series in W2 starts at 3.0 and contains 171 samples.
The sample rate of W1 is 1 Hz and the sample rate of W2 is 10 Hz.
W3 contains a simple overlay of W1 and W2. Because the series do not begin at the same time, the data values do not line up on the X axis.
W4 contains an overlay of W1 and W2. The traces are X aligned such that data samples with the same X value plot at the same X coordinate.
W1: 1..10;settime(w0, "12:00");sethunits("Time");setvunits("V")
W2: 3..0.1..20;settime(w0, "12:00");sethunits("Time");setvunits("A")
W3: stripchart(w1, w2);setsym(14, 1);griddot;gridhv
W4: w1;setsym(14);overlay(w2);focus(2);scales(13);overlayxsync();
Similar to above, except wall clock time is used as the X axis.
The series in W1 starts at 12:00:01 and contains 10 samples.
The series in W2 starts at 12:00:03 and contains 171 samples.
The sample rate of W1 is 1 Hz and the sample rate of W2 is 10 Hz.
W3 contains a simple stripchart of W1 and W2. The stripchart automatically aligns the data values in each trace on the common time axis.
W4 contains an overlay of W1 and W2. Similar to the stripchart, the traces are time aligned such that data samples with the same time value plot at the same X coordinate.
W1: 1..10;settime(w0, "12:00");sethunits("Time");setvunits("V")
W2: 3..0.1..20;settime(w0, "12:00");sethunits("Time");setvunits("A")
W3: stripchart(w2, w1);setsym(14, 2);griddot;gridhv
W4: w2;overlay(w1);focus(2);scales(13);setsym(14);overlayxsync();
Same as above except the input series are swapped. The data values of W4 still line up in time, but since the first trace has more samples per second, there may not be a corresponding value of the second trace for every sample of the first trace.
W1: 1..10;settime(w0, "12:00");sethunits("Time");setvunits("V")
W2: 3..0.1..20;settime(w0, "12:00");sethunits("Time");setvunits("A")
W3: (y1, y2) = timesync(w1, w2);y2;overlay(y1);focus(2);scales(13);setsym(14);focus(1);
W4: (y1, y2) = timesync(w1, w2);y2;overlay(y1);focus(2);scales(13);setsym(14);overlayxsync();
Same as above except the series are first time synchronized by TIMESYNC to have the same sample rate. The data values of W4 line up in time, and each value of the first trace has a corresponding value in the second trace.
OVERLAYXSYNC synchronizes overlays by adjusting the window extent so X values align as with an OVERPLOT. The data values are not changed.
If maxrange is 0, the X range of each overlay is set to the X range of the root series.
If maxrange is 1 (default), the X range of each overlay is set to the maximum X extent of all the series.
See TIMESYNC to perform time synchronization of two series by resampling and extraction.