PeakMap ms_bokeh#

This example plots a peakmap with marginals by setting add_marginals=True A chromatogram is shown along the x-axis and a spectrum is shown along the y-axis.

/home/runner/work/pyopenms_viz/pyopenms_viz/pyopenms_viz/_bokeh/core.py:587: UserWarning:


You are attempting to set `plot.legend.orientation` on a plot that has zero legends added, this will have no effect.

Before legend properties can be set, you must add a Legend explicitly, or call a glyph method with a legend parameter set.
GridPlot(
id = 'p1226', …)



import pandas as pd
from pyopenms_viz.util import download_file

pd.options.plotting.backend = "ms_bokeh"

url = "https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1"
local_path = "ionMobilityTestFeatureDf.tsv"
download_file(url, local_path)
df = pd.read_csv(local_path, sep="\t")

df.plot(
    kind="peakmap",
    x="rt",
    y="mz",
    z="int",
    add_marginals=True,
    aggregate_duplicates=True,
)

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

Gallery generated by Sphinx-Gallery