Skip to content
Draft
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a31bca1
Correct C2v to match ITOC
argerlt Jun 30, 2025
ca5a391
matching symmetry lists and names to ITOC
argerlt Jun 30, 2025
37a9db7
update _get_laue_group_name to be proceedural instead of a name-based…
argerlt Jun 30, 2025
445435f
expand symmetry marker and add example
argerlt Jul 1, 2025
8e3e490
formatting
argerlt Jul 1, 2025
c9d17ab
make tables sphinx-compatable
argerlt Jul 1, 2025
c01f09b
formatting
argerlt Jul 1, 2025
ecf5a5a
add suggestions from #563 review
argerlt Jul 3, 2025
228a7dc
Merge branch 'develop' into UpdatingSymmetryWithExamples
argerlt Jul 3, 2025
a9af706
moving plot_symmetry_operations algo to Symmetry function
argerlt Jul 4, 2025
b46e977
formatting
argerlt Jul 4, 2025
d9bbfd5
create PointGroups class, improve Symmetry.plot, and fix example
argerlt Jul 9, 2025
fed56bc
formatting
argerlt Jul 9, 2025
da8269d
finishing symmetry.plot and adding to PointGroups
argerlt Jul 9, 2025
46e8663
typos
argerlt Jul 9, 2025
19b6e47
formatting
argerlt Jul 10, 2025
276d456
more formatting
argerlt Jul 10, 2025
31b13be
Update RTD objects.inv link
hakonanes Jul 9, 2025
55be041
Disallow numpydoc v1.9.0 (#570)
hakonanes Jul 9, 2025
556a8ad
Specify custom pytest markers in pyproject.toml, simplify naming (#570)
hakonanes Jul 10, 2025
c87ece2
Fix rst formatting typo (#570)
hakonanes Jul 10, 2025
ea29fb2
Fix docstring of new expand asymmetric unit function (#570)
hakonanes Jul 10, 2025
10db466
Fix docstring of new to/from SciPy rotation functions (#570)
hakonanes Jul 10, 2025
7632cef
Update type hints in rotation class (#570)
hakonanes Jul 10, 2025
2fe05da
Remove test fixture that unnecessarily complicated use of files (#570)
hakonanes Jul 11, 2025
d9074cb
Remove use of typing.Self, which is not available until Python 3.11 (…
hakonanes Jul 11, 2025
9a81c45
Error codes description in CTF file
ondrolexa Jul 13, 2025
ecb3db4
format fix
ondrolexa Jul 13, 2025
8d7c8f6
Add @ondrolexa to contributors, sort according to additions list on d…
hakonanes Jul 14, 2025
102f5f5
Update type hints and modify code slightly in CTF reader
hakonanes Jul 14, 2025
46c6cac
Make CTF reader less error prone, improve comments
hakonanes Jul 14, 2025
fb3004c
Merge pull request #574 from ondrolexa/ctf-reader-codes
hakonanes Jul 14, 2025
89a1bf6
Merge pull request #571 from hakonanes/570-fix-doc-build-numpydoc
hakonanes Jul 16, 2025
085be4a
Correct C2v to match ITOC
argerlt Jun 30, 2025
5c6a8f7
matching symmetry lists and names to ITOC
argerlt Jun 30, 2025
daf7b65
update _get_laue_group_name to be proceedural instead of a name-based…
argerlt Jun 30, 2025
5e1f8cd
expand symmetry marker and add example
argerlt Jul 1, 2025
9fc91d6
formatting
argerlt Jul 1, 2025
54cd0a1
make tables sphinx-compatable
argerlt Jul 1, 2025
70adbc7
formatting
argerlt Jul 1, 2025
18d9005
add suggestions from #563 review
argerlt Jul 3, 2025
ec32242
moving plot_symmetry_operations algo to Symmetry function
argerlt Jul 4, 2025
9478f33
formatting
argerlt Jul 4, 2025
e71059e
create PointGroups class, improve Symmetry.plot, and fix example
argerlt Jul 9, 2025
c35bc06
formatting
argerlt Jul 9, 2025
f472f11
finishing symmetry.plot and adding to PointGroups
argerlt Jul 9, 2025
1c381b3
typos
argerlt Jul 9, 2025
c541b31
formatting
argerlt Jul 10, 2025
8e38b67
more formatting
argerlt Jul 10, 2025
1460020
Documentation improvements
argerlt Jul 17, 2025
154405f
Merge branch 'UpdatingSymmetryWithExamples' of https://github.com/arg…
argerlt Jul 17, 2025
ae62fcf
Addressing feedback on #563
argerlt Jul 18, 2025
3e9aa80
fix broken reference to old class feature
argerlt Jul 18, 2025
396972c
fix D3h name and improve explination on plot_symmetry_operations.py
argerlt Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 33 additions & 40 deletions examples/stereographic_projection/plot_symmetry_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,44 @@
Plot symmetry operations
========================

This example shows how to draw proper symmetry operations :math:`s`
(no reflections or inversions).
This example shows how stereographic projections with symmetry operators can be
automatically generated for the 32 crystallographic point groups.

The ordering follows the one given in section 9.2 of "Structures of Materials"
(DeGraef et.al, 2nd edition, 2012), starting with the cyclic groups, then the
dihedral groups, then those same groups plus inversion centers, then the successive
application of mirror planes and secondary rotational symmetries until all 32
groups are made.

The plots themselves as well as their labels follow the standards given in
Table 10.2.2 of the "International Tables of Crystallography, Volume A" (ITOC).
Both the nomenclature and marker styles thus differ slightly from some textbooks, as
there are some arbitrary convention choices in both Schoenflies notation and marker
styles.

Orix uses Schoenflies Notation (left label above each plot) for variable names since
they are short and always begin with a letter, but both Schoenflies and
Hermann-Mauguin (right label above each plot) names can be used to look up symmetry
groups using `PointGroups.get()`
"""

import matplotlib.pyplot as plt

from orix import plot
import orix.plot
from orix.quaternion.symmetry import PointGroups
from orix.vector import Vector3d

marker_size = 200
fig, (ax0, ax1) = plt.subplots(
ncols=2,
subplot_kw={"projection": "stereographic"},
layout="tight",
)
# create a list of the 32 crystallographic point groups
point_groups = PointGroups.get_set("procedural")

ax0.set_title("432", pad=20)
# 4-fold (outer markers will be clipped a bit...)
v4fold = Vector3d([[0, 0, 1], [1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0]])
ax0.symmetry_marker(v4fold, fold=4, c="C4", s=marker_size)
ax0.draw_circle(v4fold, color="C4")
# 3-fold
v3fold = Vector3d([[1, 1, 1], [1, -1, 1], [-1, -1, 1], [-1, 1, 1]])
ax0.symmetry_marker(v3fold, fold=3, c="C3", s=marker_size)
ax0.draw_circle(v3fold, color="C3")
# 2-fold
# fmt: off
v2fold = Vector3d(
[
[ 1, 0, 1],
[ 0, 1, 1],
[-1, 0, 1],
[ 0, -1, 1],
[ 1, 1, 0],
[-1, -1, 0],
[-1, 1, 0],
[ 1, -1, 0],
]
# prepare the plots
fig, ax = plt.subplots(
4, 8, subplot_kw={"projection": "stereographic"}, figsize=[14, 10]
)
# fmt: on
ax0.symmetry_marker(v2fold, fold=2, c="C2", s=marker_size)
ax0.draw_circle(v2fold, color="C2")

ax1.set_title("222", pad=20)
# 2-fold
v2fold = Vector3d([[0, 0, 1], [1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0]])
ax1.symmetry_marker(v2fold, fold=2, c="C2", s=2 * marker_size)
ax1.draw_circle(v2fold, color="C2")
ax = ax.flatten()

# create a vector to mirror over axes
v = Vector3d.from_polar(65, 80, degrees=True)
# Iterate through the 32 Point groups
for i, pg in enumerate(point_groups):
pg.plot(asymetric_vector=v, plt_axis=ax[i], itoc_style=True)
12 changes: 4 additions & 8 deletions orix/crystal_map/phase_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@
import matplotlib.colors as mcolors
import numpy as np

from orix.quaternion.symmetry import (
_EDAX_POINT_GROUP_ALIASES,
Symmetry,
_groups,
get_point_group,
)
from orix.quaternion.symmetry import _EDAX_POINT_GROUP_ALIASES, PointGroups, Symmetry
from orix.vector import Miller, Vector3d

# All named Matplotlib colors (tableau and xkcd already lower case hex)
Expand Down Expand Up @@ -232,21 +227,22 @@ def point_group(self) -> Symmetry | None:
Point group.
"""
if self.space_group is not None:
return get_point_group(self.space_group.number)
return PointGroups.from_space_group(self.space_group.number)
else:
return self._point_group

@point_group.setter
def point_group(self, value: int | str | Symmetry | None) -> None:
"""Set the point group."""
groups = PointGroups._pg_sets["permutations_repeated"]
if isinstance(value, int):
value = str(value)
if isinstance(value, str):
for key, aliases in _EDAX_POINT_GROUP_ALIASES.items():
if value in aliases:
value = key
break
for point_group in _groups:
for point_group in groups:
if value == point_group.name:
value = point_group
break
Expand Down
125 changes: 0 additions & 125 deletions orix/plot/_symmetry_marker.py

This file was deleted.

Loading
Loading