From 19f4f2eaece8daebcc3fdc8a9e22ff85aea132cd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 11 Jan 2022 00:36:49 +0100 Subject: [PATCH] nice example too simple for full-flegded ipython notebook --- python/damask/_orientation.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/damask/_orientation.py b/python/damask/_orientation.py index e727c54ae..2fc2a7d4a 100644 --- a/python/damask/_orientation.py +++ b/python/damask/_orientation.py @@ -514,6 +514,17 @@ class Orientation(Rotation,Crystal): [ 0.07359167 -0.36505797 0.92807163]] Bunge Eulers / deg: (11.40, 21.86, 0.60) + Plot a sample from the Mackenzie distribution. + + >>> import matplotlib.pyplot as plt + >>> import damask + >>> N = 10000 + >>> a = damask.Orientation.from_random(shape=N,family='cubic') + >>> b = damask.Orientation.from_random(shape=N,family='cubic') + >>> d = a.disorientation(b).as_axis_angle(degrees=True,pair=True)[1] + >>> plt.hist(d,25) + >>> plt.show() + """ if self.family != other.family: raise NotImplementedError('disorientation between different crystal families')