diff options
author | Stany MARCEL <stanypub@gmail.com> | 2016-06-08 23:56:04 +0300 |
---|---|---|
committer | Stany MARCEL <stanypub@gmail.com> | 2016-06-08 23:56:04 +0300 |
commit | 722f9bf007f98e859cd697a548d1284eb4a7d34d (patch) | |
tree | e888c72b46cf2684f2d1c6cc91dc5cf5ec009d4f | |
parent | afd1b74406ce9e67314194a0d1e528c73d0c5ddd (diff) | |
parent | f01ea3fbb99b49c0f52aa410cb5e7c1d6ab3deef (diff) |
Merge pull request #34 from bchretien/topic/fix-gyro-plot
sc-gyro-plot.py: fix size mismatch
-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() |