Note
Go to the end to download the full example code. or to run this example in your browser via Binder
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:601: 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.
import pandas as pd
import requests
from io import StringIO
pd.options.plotting.backend = "ms_bokeh"
# download the file for example plotting
url = "https://github.com/OpenMS/pyopenms_viz/releases/download/v0.1.5/ionMobilityTestFeatureDf.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="peakmap",
x="rt",
y="mz",
z="int",
add_marginals=True,
aggregate_duplicates=True,
)
Total running time of the script: (0 minutes 0.345 seconds)