ktk.TimeSeries.ui_sync

ktk.TimeSeries.ui_sync#

TimeSeries.ui_sync(data_keys=[], ts2=None, data_keys2=[], legend=True, max_lines=40)[source]#

Synchronize one or two TimeSeries by shifting their time.

If this method is called on only one TimeSeries, an interactive interface asks the user to click on the time to set to zero.

If another TimeSeries is given, an interactive interface allows synchronizing both TimeSeries together.

Parameters:
  • data_keys (str | list[str]) – Optional. The data keys to plot. If empty, all data is plotted.

  • ts2 (TimeSeries | None) – Optional. A second TimeSeries to be synced to the first one. This TimeSeries is modified in place.

  • data_keys2 (str | list[str]) – Optional. The data keys from the second TimeSeries to plot. If empty, all data is plotted.

  • legend (bool) – Optional. True to plot a legend, False otherwise. Default is True.

  • max_lines (int) – Optional. The maximal number of lines to plot. Default is 40. A warning is issued if plotting all the data would require more lines.

Returns:

The TimeSeries after synchronization.

Return type:

TimeSeries

Warning

This function, which has been introduced in 0.1, is still experimental and may change signature or behaviour in the future.

Notes

Matplotlib must be in interactive mode for this method to work.