Persistence graphical tools reference manual

gudhi.plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max_intervals=1000, max_barcodes=1000, inf_delta=0.1, legend=False, colormap=None, axes=None)[source]

This function plots the persistence bar code from persistence values list or from a persistence file.

Parameters
  • persistence (list of tuples(dimension, tuple(birth, death))) – Persistence intervals values list grouped by dimension.

  • persistence_file (string) – A persistence file style name (reset persistence if both are set).

  • alpha (float.) – barcode transparency value (0.0 transparent through 1.0 opaque - default is 0.6).

  • max_intervals (int.) – maximal number of intervals to display. Selected intervals are those with the longest life time. Set it to 0 to see all. Default value is 1000.

  • inf_delta (float.) – Infinity is placed at ((max_death - min_birth) x inf_delta) above max_death value. A reasonable value is between 0.05 and 0.5 - default is 0.1.

  • legend (boolean.) – Display the dimension color legend (default is False).

  • colormap (tuple of colors (3-tuple of float between 0. and 1.)) – A matplotlib-like qualitative colormaps. Default is None which means matplotlib.cm.Set1.colors.

  • axes (matplotlib.axes.Axes) – A matplotlib-like subplot axes. If None, the plot is drawn on a new set of axes.

Returns

(matplotlib.axes.Axes): The axes on which the plot was drawn.

gudhi.plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, band=0.0, max_intervals=1000, max_plots=1000, inf_delta=0.1, legend=False, colormap=None, axes=None)[source]

This function plots the persistence diagram from persistence values list or from a persistence file.

Parameters
  • persistence (list of tuples(dimension, tuple(birth, death))) – Persistence intervals values list grouped by dimension.

  • persistence_file (string) – A persistence file style name (reset persistence if both are set).

  • alpha (float.) – plot transparency value (0.0 transparent through 1.0 opaque - default is 0.6).

  • band (float.) – band (not displayed if \(\leq\) 0. - default is 0.)

  • max_intervals (int.) – maximal number of intervals to display. Selected intervals are those with the longest life time. Set it to 0 to see all. Default value is 1000.

  • inf_delta (float.) – Infinity is placed at ((max_death - min_birth) x inf_delta) above max_death value. A reasonable value is between 0.05 and 0.5 - default is 0.1.

  • legend (boolean.) – Display the dimension color legend (default is False).

  • colormap (tuple of colors (3-tuple of float between 0. and 1.)) – A matplotlib-like qualitative colormaps. Default is None which means matplotlib.cm.Set1.colors.

  • axes (matplotlib.axes.Axes) – A matplotlib-like subplot axes. If None, the plot is drawn on a new set of axes.

Returns

(matplotlib.axes.Axes): The axes on which the plot was drawn.

gudhi.plot_persistence_density(persistence=[], persistence_file='', nbins=300, bw_method=None, max_intervals=1000, dimension=None, cmap=None, legend=False, axes=None)[source]

This function plots the persistence density from persistence values list or from a persistence file. Be aware that this function does not distinguish the dimension, it is up to you to select the required one. This function also does not handle degenerate data set (scipy correlation matrix inversion can fail).

Parameters
  • persistence (list of tuples(dimension, tuple(birth, death))) – Persistence intervals values list grouped by dimension.

  • persistence_file (string) – A persistence file style name (reset persistence if both are set).

  • nbins (int.) – Evaluate a gaussian kde on a regular grid of nbins x nbins over data extents (default is 300)

  • bw_method (str, scalar or callable, optional.) – The method used to calculate the estimator bandwidth. This can be ‘scott’, ‘silverman’, a scalar constant or a callable. If a scalar, this will be used directly as kde.factor. If a callable, it should take a gaussian_kde instance as only parameter and return a scalar. If None (default), ‘scott’ is used. See scipy.stats.gaussian_kde documentation for more details.

  • max_intervals (int.) – maximal number of points used in the density estimation. Selected intervals are those with the longest life time. Set it to 0 to see all. Default value is 1000.

  • dimension (int.) – the dimension to be selected in the intervals (default is None to mix all dimensions).

  • cmap (cf. matplotlib colormap.) – A matplotlib colormap (default is matplotlib.pyplot.cm.hot_r).

  • legend (boolean.) – Display the color bar values (default is False).

  • axes (matplotlib.axes.Axes) – A matplotlib-like subplot axes. If None, the plot is drawn on a new set of axes.

Returns

(matplotlib.axes.Axes): The axes on which the plot was drawn.