.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/virtual_imaging/other_virtual_imaging.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_examples_virtual_imaging_other_virtual_imaging.py: ===================== Other Virtual Imaging ===================== .. GENERATED FROM PYTHON SOURCE LINES 6-22 .. code-block:: Python import pyxem as pxm import hyperspy.api as hs vectors = pxm.utils.virtual_images_utils.get_vectors_mesh( 10, 10, 40, angle=0.0, shear=0.0 ) rois, labels = pxm.signals.DiffractionVectors2D(vectors).to_roi( radius=4, include_labels=True ) c = pxm.data.dummy_data.get_cbed_signal() c.calibration(center=None) c.plot() for r in rois: r.add_widget(c, axes=(2, 3)) c.add_marker(labels) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_001.png :alt: other virtual imaging :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_002.png :alt: Signal :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/pyxem/envs/latest/lib/python3.10/site-packages/pyxem/utils/virtual_images_utils.py:47: VisibleDeprecationWarning: Function `get_vectors_mesh()` is deprecated and will be removed in version 1.0.0. Use `utils.vectors.get_vector_mesh()` instead. since="0.18.0", removal="1.0.0", alternative="utils.vectors.get_vector_mesh" .. GENERATED FROM PYTHON SOURCE LINES 23-27 .. code-block:: Python vdfs = c.get_virtual_image(rois) vdfs.plot() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_003.png :alt: Stack of Integrated intensity Navigator :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_004.png :alt: Stack of Integrated intensity Signal :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_004.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 28-42 .. code-block:: Python # We can also use multiple different ROIs and combine them into a virtual image. r1 = hs.roi.RectangularROI(-35, -35, 35, 35) c1 = hs.roi.CircleROI(cx=25.5, cy=24.5, r=7, r_inner=0) c2 = hs.roi.CircleROI(cx=0, cy=0, r=30.5, r_inner=10.0) c.plot() for r in [r1, c1, c2]: r.add_widget(c, axes=(2, 3)) vdfs = c.get_virtual_image([r1, c1, c2]) vdfs.plot() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_005.png :alt: other virtual imaging :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_005.png :class: sphx-glr-multi-img * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_006.png :alt: Signal :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_006.png :class: sphx-glr-multi-img * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_007.png :alt: Stack of Integrated intensity Navigator :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_007.png :class: sphx-glr-multi-img * .. image-sg:: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_008.png :alt: Stack of Integrated intensity Signal :srcset: /examples/virtual_imaging/images/sphx_glr_other_virtual_imaging_008.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.619 seconds) .. _sphx_glr_download_examples_virtual_imaging_other_virtual_imaging.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: other_virtual_imaging.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: other_virtual_imaging.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_