persim.bottleneck_matching

persim.bottleneck_matching(dgm1, dgm2, matching, labels=['dgm1', 'dgm2'], ax=None)[source]

Visualize bottleneck matching between two diagrams

Parameters
  • dgm1 (Mx(>=2)) – array of birth/death pairs for PD 1

  • dgm2 (Nx(>=2)) – array of birth/death paris for PD 2

  • matching (ndarray(Mx+Nx, 3)) – A list of correspondences in an optimal matching, as well as their distance, where: * First column is index of point in first persistence diagram, or -1 if diagonal * Second column is index of point in second persistence diagram, or -1 if diagonal * Third column is the distance of each matching

  • labels (list of strings) – names of diagrams for legend. Default = [“dgm1”, “dgm2”],

  • ax (matplotlib Axis object) – For plotting on a particular axis.

Examples

dist, matching = persim.bottleneck(A_h1, B_h1, matching=True) persim.bottleneck_matching(A_h1, B_h1, matching)