When working with data on manifolds – like I do often – visualising data can help. This post is to annouce
ManifoldMakie.jl – Makie recipes to plot data on manifolds!
For quite some years I first used Asymptote, and even ported some of my Matlab code to write these to Julia when I started (several years back), but surely a more Julia based variant would be nice.
After using more and more Makie.jl in examples of e.g. Manifolds.jl or Manopt.jl, I finally made the step and wrote specific recipes to make it easier to plot data!
Example
Consider symmetric positive definite (spd) matrices, that is here 3x3 symmetric matrices with positive eigenvalues. These can be potted as ellipsoids – eigenvectors as principal axes, eigenvalue as their length. These for example show up in DT-MRI. In other words, this data is an image, where every pixel is such a matrix. ManoptExamples.jl has some example data. We can now just do
using GLMakie, LinearAlgebra, ManifoldMakie, Manifolds, ManoptExamples
M = SymmetricPositiveDefinite(3)
data = ManoptExamples.artificial_SPD_image(64);
image(M, data; scale_ev = 2.0, scale_mode = :relative, colorrange = [0,0.64])
and get the following plot
Available Manifold recipes
- Circle – both angles and the complex unit circle, but also circle-valued images
- Sphere – plotting data on the sphere, connecting geodesics, scatters, but also sphere-valued images
- Hyperbolic – in 3 representations: on the hyperboloid, the Poincaré half space and the Poincaré circle/ball
- SPD-valued images as the example above.
One special new recipe concerns the generalisation of lines, which connects a sequence of points by straight lines. Since there are no straight lines on manifolds, we introduce geodesics which connects a vector of points by piecewise (shortest) geodesics, for example on the sphere.
We plan to extend this to more manifolds, wherever plotting makes sense. So if your favourite manifold falls into that, let us know!
PS: Also the Asymptote functions are available, but a bit less flexible, see ManifoldAsymptote.jl
