pyCGM2.Lib.plot.compareKinematic#
- pyCGM2.Lib.plot.compareKinematic(DATA_PATH: str, analyses: List[Analysis], legends: List, context: List, bodyPart: List, normativeDataset: NormativeData, plotType='Descriptive', eventType: str = 'Gait', pointSuffixes=None, show: bool = True, title: str | None = None, OUT_PATH=None, outputName: str | None = None, exportPng: bool = False, exportPdf: bool = False, autoYlim: bool = False)#
Plots kinematics from different analysis instances for comparison.
This function visualizes and compares kinematic data from multiple analysis instances. It supports descriptive and consistency plot types and can compare data across different contexts and body parts.
- Parameters:
DATA_PATH (str) – Path to the data directory.
analyses (List[Analysis]) – List of Analysis instances to compare.
legends (List[str]) – Labels representing each analysis instance.
context (str) – Context of the event (e.g., ‘Left’, ‘Right’).
bodyPart (str) – Body part to analyze (choices: ‘LowerLimb’, ‘Trunk’, ‘UpperLimb’).
normativeDataset (NormativeData) – Normative data instance for comparison.
plotType (str) – Type of plot (‘Descriptive’ or ‘Consistency’). Defaults to ‘Descriptive’.
eventType (str) – Event type to consider (e.g., ‘Gait’). Defaults to ‘Gait’.
pointSuffixes (Optional[List[str]]) – Suffixes previously added to model outputs. Defaults to None.
show (bool) – If True, shows the plot using Matplotlib. Defaults to True.
title (Optional[str]) – Title for the plot panel. Defaults to None.
OUT_PATH (Optional[str]) – Path for saving exported files. Defaults to None.
outputName (Optional[str]) – Name of the output file. Defaults to None.
exportPng (bool) – If True, exports the plot as a PNG. Defaults to False.
exportPdf (bool) – If True, exports the plot as a PDF. Defaults to False.
autoYlim (bool) – If True, sets Y-axis limits automatically. Defaults to False.
- 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 = compareKinematic("/data/path", [analysis1, analysis2], ["pre", "post"], "Left", "LowerLimb", normativeDataset)