chalc.plotting¶
Plotting and visualisation utilities.
Functions¶
|
Create animation of 2-skeleton of filtered simplicial complex. |
|
Visualise a 2D filtration at given time, optionally including only certain colours. |
|
Plot a specific diagram from a 6-pack. |
|
Plot the 6-pack of persistence diagrams returned by |
Module Contents¶
- animate_filtration(
- K: chalc.filtration.FilteredComplex,
- points: numpy.ndarray[tuple[Literal[2], int], numpy.dtype[numpy.floating]],
- filtration_times: collections.abc.Sequence[float],
- animation_length: float,
Create animation of 2-skeleton of filtered simplicial complex.
- Parameters:
K – A filtered complex.
points – The vertices of
K
as a \(2\times N\) numpy matrix.filtration_times – Sequence of filtration times for which to draw animation frames.
animation_length – Total length of the animation in seconds, unrelated to the
times. (filtration)
- draw_filtration(
- K: chalc.filtration.FilteredComplex,
- points: numpy.ndarray[tuple[Literal[2], int], numpy.dtype[numpy.floating]],
- time: float,
- include_colours: collections.abc.Collection[int] | None = None,
- ax: matplotlib.axes.Axes | None = None,
Visualise a 2D filtration at given time, optionally including only certain colours.
- Parameters:
K – A filtered 2-dimensional simplicial complex.
points – The vertices of
K
as a \(2\times N\) numpy matrix.time – Filtration times for which to draw simplices.
include_colours – Optional collection of colours to include. If not specified then all colours will be drawn.
ax – A matplotlib axes object. If provided then the diagram will be plotted on the given axes.
- plot_diagram(
- dgms: chalc.sixpack.DiagramEnsemble,
- diagram_name: chalc.sixpack.DiagramEnsemble.DiagramName,
- truncation: float | None = None,
- dimensions: collections.abc.Set[int] | int | None = None,
- ax: matplotlib.axes.Axes | None = None,
- tolerance: float = 0,
Plot a specific diagram from a 6-pack.
- Parameters:
dgms – The 6-pack of persistence diagrams.
diagram_name – One of
'ker'
,'cok'
,'dom'
,'cod'
,'im'
, or'rel'
.truncation – The maximum entrance time for which the diagrams are plotted. A sensible default will be calculated if not provided.
dimensions – The homological dimensions for which to plot features. If not provided, all dimensions will be included in the plots.
ax – A matplotlib axes object. If provided then the diagram will be plotted on the given axes.
tolerance – Only features with persistence greater than this value will be plotted.
- plot_sixpack(
- dgms: chalc.sixpack.DiagramEnsemble,
- truncations: collections.abc.Mapping[chalc.sixpack.DiagramEnsemble.DiagramName, float] | float | None = None,
- dimensions: collections.abc.Set[int] | int | None = None,
- tolerance: float = 0,
Plot the 6-pack of persistence diagrams returned by
compute
.- Parameters:
dgms – The 6-pack of persistence diagrams.
truncations – The maximum entrance time upto which features are plotted. Can be either a single value, or a mapping from diagram names to values. A sensible default will be calculated (for each individual diagram) if not provided.
dimensions – The homological dimensions for which to plot features. If not provided, all dimensions will be included in the plots.
tolerance – Only features with persistence greater than this value will be plotted.