.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\region_of_interest\map_signal.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_region_of_interest_map_signal.py: Create Map from ROI in signal space =================================== Use the :func:`~.api.plot.plot_roi_map` function to create interactive maps defined from ROIs in signal space. .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python import hyperspy.api as hs .. GENERATED FROM PYTHON SOURCE LINES 13-14 Create a signal: .. GENERATED FROM PYTHON SOURCE LINES 14-16 .. code-block:: Python s = hs.data.two_gaussians() .. GENERATED FROM PYTHON SOURCE LINES 17-19 Add 2 ROIs in signal space and map the corresponding signal using :func:`~.api.plot.plot_roi_map` The ROIs are added to the plot of the signal: .. GENERATED FROM PYTHON SOURCE LINES 19-22 .. code-block:: Python s.plot() roi = hs.plot.plot_roi_map(s, rois=2) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_001.png :alt: Two Gaussians Navigator :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_002.png :alt: Two Gaussians Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_003.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_004.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 23-24 Same as above, but plotting the maps in a single figure: .. GENERATED FROM PYTHON SOURCE LINES 24-29 .. code-block:: Python s.plot() roi = hs.plot.plot_roi_map(s, rois=2, single_figure=True) # Choose this figure as gallery thumbnail: # sphinx_gallery_thumbnail_number = 7 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_005.png :alt: Two Gaussians Navigator :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_006.png :alt: Two Gaussians Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_007.png :alt: map signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_007.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 30-31 Same as in previous step, but additionally specifying ``cmap`` and ``colors``: .. GENERATED FROM PYTHON SOURCE LINES 31-33 .. code-block:: Python s.plot() roi = hs.plot.plot_roi_map(s, rois=2, color=["r", "b"], cmap="gray", single_figure=True) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_008.png :alt: Two Gaussians Navigator :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_009.png :alt: Two Gaussians Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_010.png :alt: map signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_010.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.549 seconds) .. _sphx_glr_download_auto_examples_region_of_interest_map_signal.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: map_signal.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: map_signal.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_