Chromatogram ms_matplotlib#

This example shows a chromatogram colored by mass trace. Since all fragment ion spectra coelute this provides strong evidence that the peptide is present.

Chromatogram
/home/runner/work/pyopenms_viz/pyopenms_viz/pyopenms_viz/_core.py:250: UserWarning:

Duplicate data detected, data will not be aggregated which may lead to unexpected plots. To enable aggregation set `aggregate_duplicates=True`.

import pandas as pd
import requests
from io import StringIO

pd.options.plotting.backend = "ms_matplotlib"


# download the file for example plotting
url = "https://github.com/OpenMS/pyopenms_viz/releases/download/v0.1.5/ionMobilityTestChromatogramDf.tsv"
response = requests.get(url)
response.raise_for_status()  # Check for any HTTP errors
df = pd.read_csv(StringIO(response.text), sep="\t")

df.plot(
    kind="chromatogram",
    x="rt",
    y="int",
    by="Annotation",
    legend=dict(bbox_to_anchor=(1, 0.7)),
)

Total running time of the script: (0 minutes 0.230 seconds)

Gallery generated by Sphinx-Gallery