persistence_diagram#
- persistence_diagram(feature_persistence, h_inf_scalefactor=1.05, marker_size=50, ax=None, figure_kwargs={}, scatter_kwargs={}, line_kwargs={})#
Plots a persistence diagram for given feature persistence data.
A persistence diagram is a scatter plot where the x-axis represents the birth time of features and the y-axis represents their death time. The diagonal line represents the line of equality, where birth and death times of a feature are equal. Values further from this line indicate more persistent features.
- Parameters:
- feature_persistencedict
Dictionary containing persistence data. Must have a key ‘dgms’ which defines each feature’s persistence.
- h_inf_scalefactorfloat
Scalefactor used for upper bound on h-infinity.
- marker_sizeint or float, optional
Size of the markers in the plot. Must be a positive number. Default is 20.
- axmatplotlib.axes.Axes, optional
Matplotlib Axes object. If None, a new figure and axes will be created.
- figure_kwargsdict, optional
Additional keyword arguments for the figure creation.
- scatter_kwargsdict, optional
Additional keyword arguments for Matplotlib scatter plot.
- line_kwargsdict, optional
Additional keyword arguments for Matplotlib line plot.
- Returns:
- tuple
The current figure and axes (matplotlib.figure.Figure, matplotlib.axes.Axes).
- Raises:
- ValueError
If marker_size is a negative number.
- TypeError
If marker_size is not a number or if feature_persistence is not a dictionary with a ‘dgms’ key.