<jupyter_start><jupyter_text>This notebook is part of the orix documentation https://orix.readthedocs.io. Links to the documentation won’t work from the notebook.  Visualizing point groupsPoint group symmetry operations are shown here in the stereographic projection.Vectors located on the upper (`z >= 0`) hemisphere are displayed as points (`o`), whereas vectors on the lower hemisphere are reprojected onto the upper hemisphere and shown as crosses (`+`) by default. For more information about plot formatting and visualization, see [Vector3d.scatter()](reference.rstorix.vector.Vector3d.scatter).More explanation of these figures is provided at http://xrayweb.chem.ou.edu/notes/symmetry.htmlpoint.<jupyter_code>%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np

from orix import plot
from orix.quaternion import Rotation, symmetry
from orix.vector import Vector3d

plt.rcParams.update({"font.size": 15})<jupyter_output><empty_output><jupyter_text>For example, the `O (432)` point group:<jupyter_code>symmetry.O.plot()<jupyter_output><empty_output><jupyter_text>The stereographic projection of all point groups is shown below:<jupyter_code># fmt: off
schoenflies = [
    "C1", "Ci",                                          # triclinic,
    "C2x", "C2y", "C2z", "Csx", "Csy", "Csz", "C2h",     # monoclinic
    "D2", "C2v", "D2h",                                  # orthorhombic
    "C4", "S4", "C4h", "D4", "C4v", "D2d", "D4h",        # tetragonal
    "C3", "S6", "D3x", "D3y", "D3", "C3v", "D3d", "C6",  # trigonal
    "C3h", "C6h", "D6", "C6v", "D3h", "D6h",             # hexagonal
    "T", "Th", "O", "Td", "Oh",                          # cubic
]
# fmt: on

assert len(symmetry._groups) == len(schoenflies)

schoenflies = [s for s in schoenflies if not (s.endswith("x") or s.endswith("y"))]

assert len(schoenflies) == 32

orientation = Rotation.from_axes_angles((-1, 8, 1), np.deg2rad(65))

fig, ax = plt.subplots(
    nrows=8, ncols=4, figsize=(10, 20), subplot_kw=dict(projection="stereographic")
)
ax = ax.ravel()

for i, s in enumerate(schoenflies):
    sym = getattr(symmetry, s)

    ori_sym = sym.outer(orientation)
    v = ori_sym * Vector3d.zvector()

    # reflection in the projection plane (x-y) is performed internally in
    # Symmetry.plot() or when using the `reproject=True` argument for
    # Vector3d.scatter()
    v_reproject = Vector3d(v.data.copy())
    v_reproject.z *= -1

    # the Symmetry marker formatting for vectors on the upper and lower hemisphere
    # can be set using `kwargs` and `reproject_scatter_kwargs`, respectively, for
    # Symmetry.plot()

    # vectors on the upper hemisphere are shown as open circles
    ax[i].scatter(v, marker="o", fc="None", ec="k", s=150)
    # vectors on the lower hemisphere are reprojected onto the upper hemisphere and
    # shown as crosses
    ax[i].scatter(v_reproject, marker="+", ec="C0", s=150)

    ax[i].set_title(f"${s}$ $({sym.name})$")
    ax[i].set_labels("a", "b", None)

fig.tight_layout()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13712594541269318, 'fraction_numerical': 0.02071686945083854, 'mean_word_length': 3.820919175911252, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '11020', 'license': 'MIT', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1037, 'n_words': 300, 'path': 'doc/point_groups.ipynb', 'repo_name': 'bm424/texpy', 'size': '3041'}