geomstats.visualization package#
Submodules#
geomstats.visualization.hyperbolic module#
Visualization for Geometric Statistics.
- class geomstats.visualization.hyperbolic.PoincareDisk(points=None, coords_type='extrinsic')[source]#
Bases:
object
geomstats.visualization.hypersphere module#
Visualization for Geometric Statistics.
- class geomstats.visualization.hypersphere.Circle(n_angles=100, points=None)[source]#
Bases:
object
Class used to draw a circle.
- class geomstats.visualization.hypersphere.Sphere(n_meridians=40, n_circles_latitude=None, points=None)[source]#
Bases:
object
Create the arrays sphere_x, sphere_y, sphere_z to plot a sphere.
Create the arrays sphere_x, sphere_y, sphere_z of values to plot the wireframe of a sphere. Their shape is (n_meridians, n_circles_latitude).
- get_fibonnaci_points(n_points=16000)[source]#
Get spherical Fibonacci point sets.
Point sets are yield nearly uniform point distributions on the unit sphere.
geomstats.visualization.poincare_polydisk module#
Visualization for Geometric Statistics.
geomstats.visualization.pre_shape module#
Visualization for Geometric Statistics.
- class geomstats.visualization.pre_shape.KendallDisk(points=None, coords_type='pre-shape')[source]#
Bases:
object
Class used to plot points in Kendall shape space of 3D triangles.
The shape space of 2D triangles is isometric to the 2-sphere of radius 1/2 [K1984]. This isometry induced another isometry between the shape space of 3D triangle and the 1-ball of radius pi/4 [LK1993]. Following the first visualization class “KendallSphere” for 2D triangles, this class encodes the 2D isometric representation of Kendall shape space of order (3,3).
- points#
List of points to plot on the Kendall sphere.
- Type:
list
- coords_type#
Type of the points. Can be either ‘pre-shape’ (for points in Kendall pre-shape space) or ‘extrinsic’ (for points given as 3x2 matrices). Optional, default: ‘pre-shape’.
- Type:
str
- pole#
Equilateral triangle in 2D (north pole).
- Type:
array-like, shape=[3,2]
- centre#
Equilateral triangle in 3D (centre).
- Type:
array-like, shape=[3,3]
- ua#
Tangent vector at north pole toward isosceles triangle at vertex A.
- Type:
array-like, shape=[3,2]
- ub#
Tangent vector at north pole toward isosceles triangle at vertex B.
- Type:
array-like, shape=[3,2]
- na#
Tangent vector such that (ua,na) is a positively oriented orthonormal basis of the horizontal space at north pole.
- Type:
array-like, shape=[3,2]
References
[K1984]David G. Kendall. “Shape Manifolds, Procrustean Metrics, and Complex Projective Spaces.” Bulletin of the London Mathematical Society, Volume 16, Issue 2, March 1984, Pages 81–121. https://doi.org/10.1112/blms/16.2.81
[LK1993]Huiling Le and David G. Kendall. “The Riemannian structure of Euclidean shape spaces: a novel environment for statistics.” Annals of statistics, 1993, vol. 21, no 3, p. 1225-1271. https://doi.org/10.1112/blms/16.2.81
- draw(n_r=7, n_theta=25, scale=0.05)[source]#
Draw the disk regularly sampled with corresponding triangles.
- class geomstats.visualization.pre_shape.KendallSphere(points=None, coords_type='pre-shape')[source]#
Bases:
object
Class used to plot points in Kendall shape space of 2D triangles.
David G. Kendall showed that the shape space of 2D triangles is isometric to the 2-sphere of radius 1/2 [K1984]. This class encodes this isometric representation, offering a 3D visualization of Kendall shape space of order (3,2), and its related objects.
- points#
List of points to plot on the Kendall sphere.
- Type:
list
- coords_type#
Type of the points. Can be either ‘pre-shape’ (for points in Kendall pre-shape space) or ‘extrinsic’ (for points given as 3x2 matrices). Optional, default: ‘pre-shape’.
- Type:
str
- pole#
Equilateral triangle (north pole).
- Type:
array-like, shape=[3,2]
- ua#
Tangent vector toward isosceles triangle at vertex A.
- Type:
array-like, shape=[3,2]
- ub#
Tangent vector toward isosceles triangle at vertex B.
- Type:
array-like, shape=[3,2]
- na#
Tangent vector such that (ua,na) is a positively oriented orthonormal basis of the horizontal space at north pole.
- Type:
array-like, shape=[3,2]
References
[K1984]David G. Kendall. “Shape Manifolds, Procrustean Metrics, and Complex Projective Spaces.” Bulletin of the London Mathematical Society, Volume 16, Issue 2, March 1984, Pages 81–121. https://doi.org/10.1112/blms/16.2.81
- draw(n_theta=25, n_phi=13, scale=0.05, elev=60.0, azim=0.0)[source]#
Draw the sphere regularly sampled with corresponding triangles.
- draw_triangle(theta, phi, scale)[source]#
Draw the corresponding triangle on the sphere at theta, phi.
geomstats.visualization.spd_matrices module#
Visualization for Geometric Statistics.
- class geomstats.visualization.spd_matrices.Ellipses(k_sampling_points=100)[source]#
Bases:
object
Class used to plot points on the manifold SPD(2).
Elements S of the manifold of 2D Symmetric Positive Definite matrices can be conveniently represented by ellipses.
We write \(S = O D O^T\) with \(O\) an orthogonal matrix (rotation) and \(D\) a diagonal matrix. The positive eigenvalues, i.e. the elements of \(D\), are the inverse of the length of the major and minor axes of the ellipse. The rotation matrix \(O\) determines the orientation of the 2D ellipse in the 2D plane.
- Parameters:
k_sampling_points (int) – Number of points to sample on the discretized ellipses.
- compute_coordinates(point)[source]#
Compute the ellipse coordinates of a 2D SPD matrix.
- Parameters:
point (array-like, shape=[2, 2]) – SPD matrix.
- Returns:
x_coords (array-like, shape=[k_sampling_points,]) – x_coords coordinates of the sampling points on the discretized ellipse.
Y (array-like, shape = [k_sampling_points,]) – y coordinates of the sampling points on the discretized ellipse.
- draw_points(points=None, ax=None, **plot_kwargs)[source]#
Draw the ellipses.
- Parameters:
ax (Axis) – Axis of the figure.
points (array-like, shape=[…, 2, 2]) – Points on the SPD manifold of 2D symmetric positive definite matrices. Optional, default: None.
plot_kwargs (dict) – Dictionary of arguments related to plotting.
geomstats.visualization.special_euclidean module#
Visualization for Geometric Statistics.
geomstats.visualization.special_orthogonal module#
Visualization for Geometric Statistics.
- class geomstats.visualization.special_orthogonal.Arrow3D(point, vector)[source]#
Bases:
object
An arrow in 3d, i.e. a point and a vector.
- class geomstats.visualization.special_orthogonal.Trihedron(point, vec_1, vec_2, vec_3)[source]#
Bases:
object
A trihedron, i.e. 3 Arrow3Ds at the same point.
- geomstats.visualization.special_orthogonal.convert_to_trihedron(point, space=None)[source]#
Transform a rigid point into a trihedron.
Transform a rigid point into a trihedron such that:
the trihedron’s base point is the translation of the origin of R^3 by the translation part of point,
the trihedron’s orientation is the rotation of the canonical basis of R^3 by the rotation part of point.
Module contents#
The Visualization Package.
- geomstats.visualization.plot(points, ax=None, space=None, coords_type=None, **point_draw_kwargs)[source]#
Plot points in one of the implemented manifolds.
The implemented manifolds are:
the special orthogonal group SO(3)
the special Euclidean group SE(3)
the circle S1 and the sphere S2
the hyperbolic plane (the Poincare disk, the Poincare half plane and the Klein disk)
the Poincare polydisk
the Kendall shape space of 2D triangles
the Kendall shape space of 3D triangles
- Parameters:
points (array-like, shape=[…, dim]) – Points to be plotted.
space (str, optional, {‘SO3_GROUP’, ‘SE3_GROUP’, ‘S1’, ‘S2’,) – ‘H2_poincare_disk’, ‘H2_poincare_half_plane’, ‘H2_klein_disk’, ‘poincare_polydisk’, ‘S32’, ‘M32’, ‘S33’, ‘M33’, ‘SPD2’}
coords_type (str, optional, {‘extrinsic’, ‘ball’, ‘half-space’, ‘pre-shape’})