Visualization for Geometric Statistics.

class geomstats.visualization.Arrow3D(point, vector)[source]

An arrow in 3d, i.e. a point and a vector.

draw(ax, **quiver_kwargs)[source]

Draw the arrow in 3D plot.

class geomstats.visualization.Circle(n_angles=100, points=None)[source]

Class used to draw a circle.

class geomstats.visualization.PoincareHalfPlane(points=None, point_type='half-space')[source]

Class used to plot points in the Poincare Half Plane.

class geomstats.visualization.PoincarePolyDisk(points=None, point_type='ball', n_disks=2)[source]

Class used to plot points in the Poincare polydisk.


Add points to draw.


Clear the points to draw.

static convert_to_poincare_coordinates(points)[source]

Convert points to poincare coordinates.

draw(ax, **kwargs)[source]


static set_ax(ax=None)[source]

Define the ax parameters.

class geomstats.visualization.SpecialEuclidean2(points=None, point_type='matrix')[source]

Class used to plot points in the 2d special euclidean group.

class geomstats.visualization.Sphere(n_meridians=40, n_circles_latitude=None, points=None)[source]

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).


Spherical Fibonacci point sets yield nearly uniform point distributions on the unit sphere.

plot_heatmap(ax, scalar_function, n_points=16000, alpha=0.2, cmap='jet')[source]

Plot a heatmap defined by a loss on the sphere.

class geomstats.visualization.Trihedron(point, vec_1, vec_2, vec_3)[source]

A trihedron, i.e. 3 Arrow3Ds at the same point.

draw(ax, **arrow_draw_kwargs)[source]

Draw the trihedron by drawing its 3 Arrow3Ds.

Arrows are drawn is order using green, red, and blue to show the trihedron’s orientation.

geomstats.visualization.convert_to_trihedron(point, space=None)[source]

Transform a rigid point into a trihedron.

Transform a rigid point into a trihedron s.t.: - 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.

geomstats.visualization.plot(points, ax=None, space=None, point_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

  • 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’}

  • point_type (str, optional, {‘extrinsic’, ‘ball’, ‘half-space’})