.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples\create_signal\1D_image_stack.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_create_signal_1D_image_stack.py: Creates a 3D image ================== This example creates an image stack and plots it. .. GENERATED FROM PYTHON SOURCE LINES 7-34 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/create_signal/images/sphx_glr_1D_image_stack_001.png :alt: Random image stack Navigator :srcset: /auto_examples/create_signal/images/sphx_glr_1D_image_stack_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/create_signal/images/sphx_glr_1D_image_stack_002.png :alt: Random image stack Signal :srcset: /auto_examples/create_signal/images/sphx_glr_1D_image_stack_002.png :class: sphx-glr-multi-img .. code-block:: Python import numpy as np import hyperspy.api as hs # Create an image stack with random data im = hs.signals.Signal2D(np.random.random((16, 32, 32))) # Define the axis properties im.axes_manager.signal_axes[0].name = 'X' im.axes_manager.signal_axes[0].units = 'nm' im.axes_manager.signal_axes[0].scale = 0.1 im.axes_manager.signal_axes[0].offset = 0 im.axes_manager.signal_axes[1].name = 'Y' im.axes_manager.signal_axes[1].units = 'nm' im.axes_manager.signal_axes[1].scale = 0.1 im.axes_manager.signal_axes[1].offset = 0 im.axes_manager.navigation_axes[0].name = 'time' im.axes_manager.navigation_axes[0].units = 'fs' im.axes_manager.navigation_axes[0].scale = 0.3 im.axes_manager.navigation_axes[0].offset = 100 # Give a title im.metadata.General.title = 'Random image stack' # Plot it im.plot() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.620 seconds) .. _sphx_glr_download_auto_examples_create_signal_1D_image_stack.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 1D_image_stack.ipynb <1D_image_stack.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 1D_image_stack.py <1D_image_stack.py>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_