.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plotting/interactive_line_profile.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_plotting_interactive_line_profile.py: Creating an Interactive Line Profile ==================================== Many times we want to measure the distance between two disks in a diffraction pattern. A lot of times programming this is a bit of a pain. With HyperSpy's interactive tools we can fairly easily create a line profile that we can interactively adjust to measure the distance between two disks in a diffraction pattern. .. GENERATED FROM PYTHON SOURCE LINES 9-25 .. code-block:: Python from pyxem.data import simulated_strain import hyperspy.api as hs strained_signal = simulated_strain( navigation_shape=(32, 32), signal_shape=(512, 512), disk_radius=20, num_electrons=1e5, strain_matrix=None, lazy=True, ) strained_signal.plot() profile = strained_signal.add_interactive_line_profile(linewidth=1) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/plotting/images/sphx_glr_interactive_line_profile_001.png :alt: interactive line profile :srcset: /examples/plotting/images/sphx_glr_interactive_line_profile_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/plotting/images/sphx_glr_interactive_line_profile_002.png :alt: Signal :srcset: /examples/plotting/images/sphx_glr_interactive_line_profile_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/plotting/images/sphx_glr_interactive_line_profile_003.png :alt: interactive line profile :srcset: /examples/plotting/images/sphx_glr_interactive_line_profile_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/65 [00:00 ($\\AA^{-1}$)', ylabel='Intensity'> .. GENERATED FROM PYTHON SOURCE LINES 60-61 sphinx_gallery_thumbnail_number = 3 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.404 seconds) .. _sphx_glr_download_examples_plotting_interactive_line_profile.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: interactive_line_profile.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: interactive_line_profile.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: interactive_line_profile.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_