.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/ms_bokeh/plot_peakmap_marginals_ms_bokeh.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_ms_bokeh_plot_peakmap_marginals_ms_bokeh.py: 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. .. GENERATED FROM PYTHON SOURCE LINES 8-31 .. bokeh-plot:: :source-position: none from bokeh.plotting import show import pandas as pd from pyopenms_viz.util import download_file pd.options.plotting.backend = "ms_bokeh" # GitHub raw URL (primary) with Zenodo as backup url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestFeatureDf.tsv" backup_url = ( "https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1" ) local_path = "ionMobilityTestFeatureDf.tsv" download_file(url, local_path, backup_url=backup_url) df = pd.read_csv(local_path, sep="\t") df.plot( kind="peakmap", x="rt", y="mz", z="int", add_marginals=True, aggregate_duplicates=True, ) .. rst-class:: sphx-glr-script-out .. code-block:: none /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. .. raw:: html
GridPlot(
id = 'p1226', …)


| .. code-block:: Python import pandas as pd from pyopenms_viz.util import download_file pd.options.plotting.backend = "ms_bokeh" # GitHub raw URL (primary) with Zenodo as backup url = "https://raw.githubusercontent.com/OpenMS/pyopenms_viz/main/test/test_data/ionMobilityTestFeatureDf.tsv" backup_url = ( "https://zenodo.org/records/17904352/files/ionMobilityTestFeatureDf.tsv?download=1" ) local_path = "ionMobilityTestFeatureDf.tsv" download_file(url, local_path, backup_url=backup_url) df = pd.read_csv(local_path, sep="\t") df.plot( kind="peakmap", x="rt", y="mz", z="int", add_marginals=True, aggregate_duplicates=True, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.179 seconds) .. _sphx_glr_download_gallery_ms_bokeh_plot_peakmap_marginals_ms_bokeh.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://notebooks.gesis.org/binder/v2/gh/OpenMS/pyopenms_viz/gh_pages?filepath=notebooks/gallery/ms_bokeh/plot_peakmap_marginals_ms_bokeh.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_peakmap_marginals_ms_bokeh.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_peakmap_marginals_ms_bokeh.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_peakmap_marginals_ms_bokeh.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_