Open stefangachter opened 3 years ago
Hi, Thanks for noticing this issue Stefan. Could you please provide a reproducible example so we can investigate the bug and solve it? Thanks!
Here, an example:
library(imudata)
library(gmwm)
imuObj <- list()
waveletVariances <- list()
data(adis_16405_imu1)
imuObj[length(imuObj)+1] <- list(imu(adis_16405_imu1, gyros=1:3, acc=4:6, axis=c('X', 'Y', 'Z'), freq=100))
waveletVariances[length(waveletVariances)+1] <- list(wvar.imu(imuObj[[length(imuObj)]]))
title = 'ADIS 16405 IMU1'
xLabel = 'Time Scale (s)'
yLabel = 'Variance'
unitAcc = 'm/s^2'
unitGyro = 'deg/s'
unitAccVar = paste('(', unitAcc, ')^2', sep='')
unitGyroVar = paste('(', unitGyro, ')^2', sep='')
legendLables = NULL
plotObj = do.call(compare_wvar, c(waveletVariances, list(split=FALSE, auto.label.wvar=FALSE, axis.x.label=xLabel, axis.y.label=yLabel, units=c(unitGyroVar, unitAccVar), title=title, legend.label=legendLables)))
plot(plotObj)
data(adis_16405_imu2)
imuObj[length(imuObj)+1] <- list(imu(adis_16405_imu2, gyros=1:3, acc=4:6, axis=c('X', 'Y', 'Z'), freq=100))
waveletVariances[length(waveletVariances)+1] <- list(wvar.imu(imuObj[[length(imuObj)]]))
title = 'ADIS 16405 IMU1 and IMU2'
legendLables = c('IMU1', 'IMU2')
plotObj = do.call(compare_wvar, c(waveletVariances, list(split=FALSE, auto.label.wvar=FALSE, axis.x.label=xLabel, axis.y.label=yLabel, units=c(unitGyroVar, unitAccVar), title=title, legend.label=legendLables)))
plot(plotObj)
If I call compare_wvar with a single wavelet variance object, then the plot is "degenerated", see image below.
plotObj = do.call(compare_wvar, c(waveletVariances, list(split=FALSE, auto.label.wvar=FALSE, axis.x.label=xLabel, axis.y.label=yLabel, units=c(unitGyroVar, unitAccVar), title=title, legend.label=legendLables)))
Same call with two wavelte variance objects: