Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was using dtw-python's
dtwPlotThreeWay
anddtwPlotTwoWay
to plot my desired angle sequence and the robotic arm's actual angle sequence prior to dtw, and found that I couldn't change the horizontal coordinates to my time series (each moment corresponds to the current desired angle and the robotic arm's actual angle), which would lead to the result in the image below:Due to the control delay, the lengths of the actual angle sequence (black line) and the desired angle sequence (blue line) of the robotic arm differ by about ten times, so the final plotted graph cannot fully demonstrate the point-to-point matching relationship between the two angle sequences. Therefore I would like to align these two angle sequences by my own recorded time series, the result of this timeseries branch is as follows:
The plotting results before and after the
dtwPlotThreeWay
change are shown below:In the timeseries branch, I added xidx and yidx to replace d.index1 and d.index2 as the horizontal coordinates, and still use the original d.index when plotting the matching points. At the same time, xidx and yidx are defaulted to None, which is the same as in the previous matser branch. Meanwhile, xidx and yidx are defaulted to None, and then, as in the previous matser branch, when xidx and yidx are the actual time series of xts and yts, respectively, they will be plotted instead of the original horizontal coordinates.
In short, when calculating the dtw between two signal sequences of different lengths, the plots of dtwPlotThreeWay and dtwPlotTwoWay do not show all the information, and this branch can unify the reference to the horizontal coordinates when adding the corresponding time series of each of the two signal sequences, and thus show more information.
I hope that this suggestion can be added to a future version, thus compensating for the shortcomings when plotting two DTW graphs with large differences in length.