pyCGM2.Lib.plot.plotTemporalKinetic#
- pyCGM2.Lib.plot.plotTemporalKinetic(DATA_PATH: str, modelledFilenames: str, bodyPart: str, pointLabelSuffix: str | None = None, exportPdf: bool = False, OUT_PATH: str | None = None, outputName: str | None = None, show: bool = True, title: str | None = None, exportPng: bool = False, autoYlim: bool = False, **kwargs)#
Displays temporal traces of CGM kinetic outputs for a specified body part.
This function generates and optionally exports a plot showing the kinetic outputs of a specified body part over time. The data is read from a C3D file, and the plot can be customized in various ways.
- Parameters:
DATA_PATH (str) – Path to the data directory.
modelledFilenames (str) – Filename of the C3D file including kinetic output.
bodyPart (str) – Body part to plot (choices: ‘LowerLimb’, ‘Trunk’, ‘UpperLimb’).
pointLabelSuffix (Optional[str]) – Suffix added to model outputs. Defaults to None.
exportPdf (bool) – If True, exports the plot as a PDF. Defaults to False.
OUT_PATH (Optional[str]) – Path for saving exported files. Defaults to None.
outputName (Optional[str]) – Name of the output file. Defaults to None.
show (bool) – If True, displays the plot using Matplotlib. Defaults to True.
title (Optional[str]) – Title for the plot panel. Defaults to None.
exportPng (bool) – If True, exports the plot as a PNG. Defaults to False.
autoYlim (bool) – If True, sets Y-axis limits automatically. Defaults to False.
- Keyword Arguments:
btkAcq (Optional[btk.Acquisition]) – If provided, uses this acquisition instead of loading from modelledFilenames.
- Returns:
Union[matplotlib.figure.Figure, Tuple[matplotlib.figure.Figure, str]] – The Matplotlib figure object.
If exporting as PNG, returns a tuple of the figure object and the filename.
Examples
>>> fig = plotTemporalKinetic("/myDATA/", "file1.c3d", "LowerLimb")
Note
Ensure the specified bodyPart is one of the valid choices. Invalid input will raise an exception.