.. 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_circleROI.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_circleROI.py: Create Map from CircleROI in signal space ========================================= Use the :func:`~.api.plot.plot_roi_map` function to create interactive maps defined from a :class:`~.api.roi.CircleROI` in signal space. .. GENERATED FROM PYTHON SOURCE LINES 9-12 .. code-block:: Python import hyperspy.api as hs import numpy as np .. GENERATED FROM PYTHON SOURCE LINES 13-14 Create a signal: .. GENERATED FROM PYTHON SOURCE LINES 14-18 .. code-block:: Python rng = np.random.default_rng(0) data = rng.random(size=(100, 100, 50, 50)) s = hs.signals.Signal2D(data) .. GENERATED FROM PYTHON SOURCE LINES 19-22 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 and by default a :class:`~.api.roi.RectangularROI` is used .. GENERATED FROM PYTHON SOURCE LINES 22-25 .. 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_circleROI_001.png :alt: map signal circleROI :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_002.png :alt: Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_003.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_004.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 26-27 Same as above but with using :class:`~.api.roi.CircleROI` with predefined position: .. GENERATED FROM PYTHON SOURCE LINES 27-32 .. code-block:: Python roi1 = hs.roi.CircleROI(cx=25, cy=25, r=5) roi2 = hs.roi.CircleROI(cx=25, cy=25, r=15, r_inner=10) s.plot() roi = hs.plot.plot_roi_map(s, rois=[roi1, roi2]) # Choose this figure as gallery thumbnail: # sphinx_gallery_thumbnail_number = 6 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_005.png :alt: map signal circleROI :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_006.png :alt: Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_007.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_008.png :alt: Integrated intensity Signal :srcset: /auto_examples/region_of_interest/images/sphx_glr_map_signal_circleROI_008.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.577 seconds) .. _sphx_glr_download_auto_examples_region_of_interest_map_signal_circleROI.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_circleROI.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: map_signal_circleROI.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_