pyCGM2.Lib.plot.plotTemporalEMG#
- pyCGM2.Lib.plot.plotTemporalEMG(DATA_PATH: str, processedEmgfile: str, rectify: bool = True, exportPdf: bool = False, outputName: str | None = None, show: bool = True, title: str | None = None, ignoreNormalActivity: bool = False, exportPng: bool = False, OUT_PATH: str | None = None, autoYlim: bool = False, **kwargs)#
Displays temporal traces of EMG signals from a processed EMG file.
This function visualizes EMG data, allowing options for rectification, title modification, and exportation in PDF or PNG formats. It can display rectified or raw EMG signals, and optionally ignores normal activity in the background.
- Parameters:
DATA_PATH (str) – Path to the data directory.
processedEmgfile (str) – Filename of the C3D file with EMG data.
- Keyword Arguments:
rectify (bool) – Display rectified (True) or raw (False) signal. Defaults to True.
exportPdf (bool) – Export the plot as a PDF. Defaults to False.
outputName (Optional[str]) – Name of the output file. Defaults to None.
show (bool) – Show the matplotlib figure. Defaults to True.
title (Optional[str]) – Modify the plot panel title. Defaults to None.
ignoreNormalActivity (bool) – Disable display of normal activity in the background. Defaults to False.
exportPng (bool) – Export the plot as a PNG. Defaults to False.
OUT_PATH (Optional[str]) – Specify an output path different than DATA_PATH. Defaults to None.
autoYlim (bool) – Ignore predefined Y-axis boundaries. Defaults to False.
- Additional Keyword Args:
btkAcq (Optional[btk.Acquisition]): Use this acquisition instead of loading from processedEmgfile. forceEmgManager (Optional[pyCGM2.EMG.EmgManager]): Use a specific EmgManager instance.
- Returns:
Union[List[matplotlib.figure.Figure], Tuple[List[matplotlib.figure.Figure], List[str]]]
A list of Matplotlib figure objects. If exporting as PNG, returns a tuple of the list of figures and list of filenames.
Examples
>>> figures = plotTemporalEMG("/myDATA/", "file1.c3d")
Note
The function can generate multiple plots depending on the number of EMG channels. Each plot can be exported separately if required.