diff options
-rwxr-xr-x | scripts/sc-gyro-plot.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/sc-gyro-plot.py b/scripts/sc-gyro-plot.py index c1648d5..47ad06f 100755 --- a/scripts/sc-gyro-plot.py +++ b/scripts/sc-gyro-plot.py @@ -102,7 +102,12 @@ def _main(): for name in imu.keys(): imu[name].append(sci._asdict()[name]) - imu[name] = imu[name][-len(times):] + nt = len(times) + ni = len(imu[name]) + if nt < ni: + imu[name] = imu[name][-nt:] + elif nt > ni: + times = times[nt-ni:] curves[name].setData(times, imu[name]) app.processEvents() |