ktk.TimeSeries.plot#

TimeSeries.plot(data_keys=[], *args, event_names=True, legend=True, **kwargs)[source]#

Plot the TimeSeries in the current matplotlib figure.

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

  • event_names (bool) – Optional. True to plot the event names on top of the event lines.

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

Return type

None

Note

Additional positional and keyboard arguments are passed to matplotlib’s pyplot.plot function:

ts.plot(["Forces"], "--")

plots the forces using a dashed line style.

Example

For a TimeSeries ts with data keys being “Forces”, “Moments” and “Angle”:

ts.plot()

plots all data (Forces, Moments and Angle), whereas:

ts.plot(["Forces", "Moments"])

plots only the forces and moments, without plotting the angle.