pyopenms.Plotting.plot_spectrum

pyopenms.Plotting.plot_spectrum(spectrum: pyopenms.pyopenms_8.MSSpectrum, color_ions: bool = True, annotate_ions: bool = True, matched_peaks: Optional[Set] = None, annot_kws: Optional[Dict] = None, mirror_intensity: bool = False, grid: Union[bool, str] = True, ax=None)

Plot an MS/MS spectrum.

spectrumMSSpectrum

The spectrum to be plotted. Reads annotations from the first StringDataArray if it has the same length as the number of peaks.

color_ionsbool, optional

Flag indicating whether or not to color annotated fragment ions. The default is True.

annotate_ionsbool, optional

Flag indicating whether or not to annotate fragment ions. The default is True.

matched_peaksOptional[Set], optional

Indices of matched peaks in a spectrum alignment.

annot_kwsOptional[Dict], optional

Keyword arguments for ax.text to customize peak annotations.

mirror_intensitybool, optional

Flag indicating whether to flip the intensity axis or not.

gridUnion[bool, str], optional

Draw grid lines or not. Either a boolean to enable/disable both major and minor grid lines or ‘major’/’minor’ to enable major or minor grid lines respectively.

axOptional[plt.Axes], optional

Axes instance on which to plot the spectrum. If None the current Axes instance is used.

plt.Axes

The matplotlib Axes instance on which the spectrum is plotted.