How to use the gudhi.plot_persistence_barcode function in gudhi

To help you get started, we’ve selected a few gudhi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GUDHI / gudhi-devel / src / cython / doc / pyplots / barcode_persistence.py View on Github external
import gudhi

periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file='../3d_torus.txt')
diag = periodic_cc.persistence()
gudhi.plot_persistence_barcode(diag)
github GUDHI / gudhi-devel / src / python / example / gudhi_graphical_tools_example.py View on Github external
print("#####################################################################")
print("Show diagram persistence example")

gudhi.plot_persistence_diagram(persistence)
plot.show()

print("#####################################################################")
print("Show diagram persistence example with a confidence band")

gudhi.plot_persistence_diagram(persistence, band=0.2)
plot.show()

print("#####################################################################")
print("Show barcode and diagram persistence side by side example")
fig, axes = plot.subplots(nrows=1, ncols=2)
gudhi.plot_persistence_barcode(persistence, axes = axes[0])
gudhi.plot_persistence_diagram(persistence, axes = axes[1])
fig.suptitle("barcode versus diagram")
plot.show()
github GUDHI / gudhi-devel / src / python / example / gudhi_graphical_tools_example.py View on Github external
__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "MIT"

print("#####################################################################")
print("Show barcode persistence example")

persistence = [
    (2, (1.0, float("inf"))),
    (1, (1.4142135623730951, float("inf"))),
    (1, (1.4142135623730951, float("inf"))),
    (0, (0.0, float("inf"))),
    (0, (0.0, 1.0)),
    (0, (0.0, 1.0)),
    (0, (0.0, 1.0)),
]
gudhi.plot_persistence_barcode(persistence)
plot.show()

print("#####################################################################")
print("Show diagram persistence example")

gudhi.plot_persistence_diagram(persistence)
plot.show()

print("#####################################################################")
print("Show diagram persistence example with a confidence band")

gudhi.plot_persistence_diagram(persistence, band=0.2)
plot.show()

print("#####################################################################")
print("Show barcode and diagram persistence side by side example")
github GUDHI / gudhi-devel / src / python / example / periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py View on Github external
if is_file_perseus(args.file):
    print("#####################################################################")
    print("PeriodicCubicalComplex creation")
    periodic_cubical_complex = gudhi.PeriodicCubicalComplex(perseus_file=args.file)

    print("persistence(homology_coeff_field=3, min_persistence=0)=")
    diag = periodic_cubical_complex.persistence(
        homology_coeff_field=3, min_persistence=0
    )
    print(diag)

    print("betti_numbers()=")
    print(periodic_cubical_complex.betti_numbers())
    if args.no_barcode == False:
        gudhi.plot_persistence_barcode(diag)
        plot.show()
else:
    print(args.file, "is not a valid perseus style file")