plot_diagram

gtda.plotting.plot_diagram(diagram, homology_dimensions=None, plotly_params=None)[source]

Plot a single persistence diagram.

Parameters
  • diagram (ndarray of shape (n_points, 3)) – The persistence diagram to plot, where the third dimension along axis 1 contains homology dimensions, and the first two contain (birth, death) pairs to be used as coordinates in the two-dimensional plot.

  • homology_dimensions (list of int or None, optional, default: None) – Homology dimensions which will appear on the plot. If None, all homology dimensions which appear in diagram will be plotted.

  • plotly_params (dict or None, optional, default: None) – Custom parameters to configure the plotly figure. Allowed keys are "traces" and "layout", and the corresponding values should be dictionaries containing keyword arguments as would be fed to the update_traces and update_layout methods of plotly.graph_objects.Figure.

Returns

fig – Figure representing the persistence diagram.

Return type

plotly.graph_objects.Figure object