MATPLOTLIBChromatogramPlot#

class pyopenms_viz._matplotlib.MATPLOTLIBChromatogramPlot(data, x, y, annotation_data: DataFrame | None = None, relative_intensity=False, **kwargs)#

Bases: MATPLOTLIB_MSPlot, ChromatogramPlot

Class for assembling a matplotlib extracted ion chromatogram plot

Plot method for creating plots from a Pandas DataFrame.

Parameters:
  • data (pandas.DataFrame or numpy.ndarray) – The data to be plotted.

  • x (str or None, optional) – The column name for the x-axis data.

  • y (str or None, optional) – The column name for the y-axis data.

  • z (str or None, optional) – The column name for the z-axis data (for 3D plots).

  • kind (str, optional) – The kind of plot to create. One of: (‘line’, ‘vline’, ‘scatter’, ‘chromatogram’, ‘mobilogram’, ‘spectrum’, ‘peakmap’)

  • by (str or None, optional) – Column in the DataFrame to group by.

  • relative_intensity (bool, default False) – Whether to use relative intensity for the y-axis.

  • subplots (bool or None, optional) – Whether to create separate subplots for each column.

  • sharex (bool or None, optional) – Whether to share x or y axes among subplots.

  • sharey (bool or None, optional) – Whether to share x or y axes among subplots.

  • height (int or None, optional) – The height and width of the figure in pixels.

  • width (int or None, optional) – The height and width of the figure in pixels.

  • grid (bool or None, optional) – Whether to show the grid on the plot.

  • toolbar_location (str or None, optional) – The location of the toolbar (e.g., ‘above’, ‘below’, ‘left’, ‘right’).

  • fig (figure or None, optional) – An existing figure object to plot on.

  • title (str or None, optional) – The title of the plot.

  • xlabel (str or None, optional) – Labels for the x and y axes.

  • ylabel (str or None, optional) – Labels for the x and y axes.

  • x_axis_location (str or None, optional) – The location of the x and y axes (e.g., ‘bottom’, ‘top’, ‘left’, ‘right’).

  • y_axis_location (str or None, optional) – The location of the x and y axes (e.g., ‘bottom’, ‘top’, ‘left’, ‘right’).

  • line_type (str or None, optional) – The type of line to use (e.g., ‘solid’, ‘dashed’, ‘dotted’).

  • line_width (float or None, optional) – The width of the lines in the plot.

  • min_border (int or None, optional) – The minimum border size around the plot.

  • show_plot (bool or None, optional) – Whether to display the plot immediately after creation.

  • legend (LegendConfig or dict or None, optional) – Configuration for the plot legend.

  • feature_config (FeatureConfig or dict or None, optional) – Configuration for additional plot features.

  • backend (str, default None) – Backend to use instead of the backend specified in the option plotting.backend. For pyopenms_viz, options are one of (‘ms_matplotlib’, ‘ms_bokeh’, ‘ms_plotly’) Alternatively, to specify the plotting.backend for the whole session, set pd.options.plotting.backend.

  • **kwargs – Additional keyword arguments to be passed to the plotting function.

Return type:

None

Examples

>>> import pandas as pd
>>>
>>> data = pd.DataFrame(dict'x': [1, 2, 3], 'y': [4, 5, 6]))
>>> data.plot(x='x', y='y', kind='spectrum', backend='pomsvim')
_add_peak_boundaries(annotation_data)#

Add peak boundaries to the plot.

Parameters:

annotation_data (DataFrame) – The feature data containing the peak boundaries.

Returns:

None