diff options
Diffstat (limited to 'src/cython/example/rips_persistence_diagram.py')
-rwxr-xr-x | src/cython/example/rips_persistence_diagram.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/cython/example/rips_persistence_diagram.py b/src/cython/example/rips_persistence_diagram.py index 3e95f2cc..57f25b22 100755 --- a/src/cython/example/rips_persistence_diagram.py +++ b/src/cython/example/rips_persistence_diagram.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import gudhi -import matplotlib.pyplot as plt """This file is part of the Gudhi Library. The Gudhi library (Geometric Understanding in Higher Dimensions) is a generic C++ @@ -9,7 +8,7 @@ import matplotlib.pyplot as plt Author(s): Marc Glisse - Copyright (C) 2016 INRIA Saclay (France) + Copyright (C) 2016 INRIA This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +25,7 @@ import matplotlib.pyplot as plt """ __author__ = "Marc Glisse" -__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)" +__copyright__ = "Copyright (C) 2016 INRIA" __license__ = "GPL v3" print("#####################################################################") @@ -37,11 +36,4 @@ rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]], diag = rips.persistence(homology_coeff_field=2, min_persistence=0) print("diag=", diag) -diag0=[i[1] for i in diag if i[0]==0] -diag1=[i[1] for i in diag if i[0]==1] - -plt.plot([i[0] for i in diag0],[min(i[1],1.5) for i in diag0],'ro', - [i[0] for i in diag1],[i[1] for i in diag1],'bs',[-.2,1.5],[-.2,1.5], - '-') -plt.axis([-.2,1.5,-.2,1.5]) -plt.show() +gudhi.bar_code_persistence(diag) |