.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/stereographic_projection/wulff_net.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_stereographic_projection_wulff_net.py: ========= Wulff net ========= This example shows how to draw a Wulff net in the stereographic projection with great and small circles. .. GENERATED FROM PYTHON SOURCE LINES 9-43 .. image-sg:: /examples/stereographic_projection/images/sphx_glr_wulff_net_001.png :alt: wulff net :srcset: /examples/stereographic_projection/images/sphx_glr_wulff_net_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from orix import plot from orix.vector import Vector3d n = int(90 / 2) # Degree / net resolution steps = 500 kwargs = dict(linewidth=0.25, color="k") polar = np.linspace(0, 0.5 * np.pi, num=n) v_right = Vector3d.from_polar(azimuth=np.zeros(n), polar=polar) v_left = Vector3d.from_polar(azimuth=np.ones(n) * np.pi, polar=polar) v010 = Vector3d.zero(shape=(n,)) v010.y = 1 v010_opposite = -v010 fig, ax = plt.subplots( figsize=(5, 5), subplot_kw=dict(projection="stereographic"), layout="tight" ) ax.stereographic_grid(False) ax.draw_circle(v_right, steps=steps, **kwargs) ax.draw_circle(v_left, steps=steps, **kwargs) ax.draw_circle(v010, opening_angle=polar, steps=steps, **kwargs) ax.draw_circle(v010_opposite, opening_angle=polar, steps=steps, **kwargs) for label, azimuth, va, ha, offset in zip( ["B", "M''", "A", "M'"], np.array([0, 0.5, 1, 1.5]) * np.pi, ["center", "bottom", "center", "top"], ["left", "center", "right", "center"], [(0.02, 0), (0, 0.02), (-0.02, 0), (0, -0.02)], ): ax.text(azimuth, 0.5 * np.pi, s=label, offset=offset, c="r", va=va, ha=ha) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.685 seconds) **Estimated memory usage:** 9 MB .. _sphx_glr_download_examples_stereographic_projection_wulff_net.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: wulff_net.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: wulff_net.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_