PlottingFilter#

class pyCGM2.Report.plotFilters.PlottingFilter#

Manages the creation and display of plots using a specified PlotViewer.

This filter is responsible for generating and exporting plots. It allows customization of plot appearance, including setting titles, Y-axis limits, and adding horizontal lines or significant difference markers.

__concretePlotViewer#

A plot viewer used to generate the plot panel.

Type:

PlotViewer

m_path#

Path where the plot will be saved.

Type:

str

m_fileName#

Name of the file to save the plot.

Type:

str

m_format#

Format of the saved plot file.

Type:

str

m_title#

Title of the plot panel.

Type:

str

__init__()#

Initializes the PlottingFilter with default attributes.

Methods

__init__()

Initializes the PlottingFilter with default attributes.

displaySignificantDiffererence(axisIndex, ...)

Displays markers for significant frames on a specified plot axis.

plot()

Generates and optionally saves the plot panel based on the current settings.

setAutomaticYlimits()

Sets the Y-axis boundaries to default values for all plot axes.

setExport(path, filename, format)

Configures the export settings for the plot.

setHorizontalLines(idict)

Sets horizontal lines on the plot axes based on the provided dictionary.

setTitle(title)

Sets the title for the plot panel.

setViewer(concretePlotViewer)

Sets the plot viewer to be used for generating the plot panel.

setYlimits(axisIndex, min, max)

Sets the Y-axis boundaries for a specific plot axis.

displaySignificantDiffererence(axisIndex: int, clusters: List)#

Displays markers for significant frames on a specified plot axis.

Parameters:
  • axisIndex (int) – Index of the matplotlib.figure.axis instance.

  • clusters (List) – List of clusters of significant frames.

plot()#

Generates and optionally saves the plot panel based on the current settings.

Returns:

A matplotlib figure object containing the generated plot.

setAutomaticYlimits()#

Sets the Y-axis boundaries to default values for all plot axes.

setExport(path: str, filename: str, format: str)#

Configures the export settings for the plot.

Parameters:
  • path (str) – Folder path where the plot will be saved.

  • filename (str) – Name of the file to save the plot.

  • format (str) – Format of the saved plot file (e.g., ‘pdf’, ‘png’).

setHorizontalLines(idict: Dict)#

Sets horizontal lines on the plot axes based on the provided dictionary.

Parameters:

idict (Dict) – Dictionary with axis labels as keys and lists of (value, color) pairs as values.

setTitle(title: str)#

Sets the title for the plot panel.

Parameters:

title (str) – Title to set for the plot panel.

setViewer(concretePlotViewer: PlotViewer)#

Sets the plot viewer to be used for generating the plot panel.

Parameters:

concretePlotViewer (PlotViewer) – A plot viewer instance.

setYlimits(axisIndex: int, min: float, max: float)#

Sets the Y-axis boundaries for a specific plot axis.

Parameters:
  • axisIndex (int) – Index of the matplotlib.figure.axis instance.

  • min (float) – Minimum value for the Y-axis.

  • max (float) – Maximum value for the Y-axis.