.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/reference_frames/plot_distribution_of_projection_centers.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_reference_frames_plot_distribution_of_projection_centers.py: Plot distribution of projection centers ======================================= This example shows how to plot a distribution of projection/pattern centers (PCs) with the :class:`~kikuchipy.detectors.EBSDDetector`. See the detector class documentation for further details on the definition of the PC and gnomonic coordinates. .. GENERATED FROM PYTHON SOURCE LINES 31-32 Imports. .. GENERATED FROM PYTHON SOURCE LINES 32-36 .. code-block:: Python import matplotlib.pyplot as plt import kikuchipy as kp .. GENERATED FROM PYTHON SOURCE LINES 37-39 Create a detector with smoothly varying PC values, extrapolated from a single PC (assumed to be in the upper left corner of a map) .. GENERATED FROM PYTHON SOURCE LINES 39-49 .. code-block:: Python det0 = kp.detectors.EBSDDetector( shape=(480, 640), pc=(0.4, 0.3, 0.5), px_size=70, sample_tilt=70 ) print(det0) det = det0.extrapolate_pc( pc_indices=[0, 0], navigation_shape=(5, 10), step_sizes=(20, 20) ) print(det) .. rst-class:: sphx-glr-script-out .. code-block:: none EBSDDetector shape (Ny, Nx): (480, 640) pc (PCx, PCy, PCz): (0.4, 0.3, 0.5) sample_tilt: 70.0° tilt: 0.0° azimuthal: 0.0° twist: 0.0° binning: 1 px_size: 70.0 um EBSDDetector shape (Ny, Nx): (480, 640) pc (PCx, PCy, PCz): (0.398, 0.299, 0.5) sample_tilt: 70.0° tilt: 0.0° azimuthal: 0.0° twist: 0.0° binning: 1 px_size: 70.0 um .. GENERATED FROM PYTHON SOURCE LINES 50-51 Plot PC values in maps. .. GENERATED FROM PYTHON SOURCE LINES 51-54 .. code-block:: Python det.plot_pc() .. image-sg:: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_001.png :alt: plot distribution of projection centers :srcset: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 55-56 Plot in scatter plots in vertical orientation. .. GENERATED FROM PYTHON SOURCE LINES 56-59 .. code-block:: Python det.plot_pc("scatter", annotate=True) .. image-sg:: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_002.png :alt: plot distribution of projection centers :srcset: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 60-61 Plot in a 3D scatter plot, returning the figure for saving etc. .. GENERATED FROM PYTHON SOURCE LINES 61-64 .. code-block:: Python fig = det.plot_pc("3d", return_figure=True) plt.show() .. image-sg:: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_003.png :alt: plot distribution of projection centers :srcset: /examples/reference_frames/images/sphx_glr_plot_distribution_of_projection_centers_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.896 seconds) **Estimated memory usage:** 790 MB .. _sphx_glr_download_examples_reference_frames_plot_distribution_of_projection_centers.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_distribution_of_projection_centers.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_distribution_of_projection_centers.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_distribution_of_projection_centers.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_