summaryrefslogtreecommitdiff
path: root/src/cython
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-08-17 12:41:10 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-08-17 12:41:10 +0000
commit67ae5aa70e70097f72f868ebba1fa8e7ff96297d (patch)
treeb76a7040b0c7039c4ae4d3216f1b2b674c21e526 /src/cython
parent1865751c055ad01ba159a13d22e42204195c2ccb (diff)
doc review : modification of persistence barcode example to make it more relevant
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/plot_persistence_density_vincent@3796 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 17acc09cdf7d09b13c177334efb1e309c4fd8d9c
Diffstat (limited to 'src/cython')
-rw-r--r--src/cython/doc/persistence_graphical_tools_user.rst25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/cython/doc/persistence_graphical_tools_user.rst b/src/cython/doc/persistence_graphical_tools_user.rst
index b21de06a..0047f9c8 100644
--- a/src/cython/doc/persistence_graphical_tools_user.rst
+++ b/src/cython/doc/persistence_graphical_tools_user.rst
@@ -19,12 +19,15 @@ This function can display the persistence result as a barcode:
import gudhi
- perseus_file = gudhi.__root_source_dir__ + '/data/bitmap/3d_torus.txt'
- periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=perseus_file)
- diag = periodic_cc.persistence()
- print("diag = ", diag)
- plt = gudhi.plot_persistence_barcode(diag)
- plt.show()
+ off_file = gudhi.__root_source_dir__ + '/data/points/tore3D_300.off'
+ point_cloud = gudhi.read_off(off_file=off_file)
+
+ rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=0.7)
+ simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
+ diag = simplex_tree.persistence(min_persistence=0.4)
+
+ plot = gudhi.plot_persistence_barcode(diag)
+ plot.show()
Show persistence as a diagram
-----------------------------
@@ -53,13 +56,9 @@ If you want more information on a specific dimension, for instance:
import gudhi
+ # rips_on_tore3D_1307.pers obtained from write_persistence_diagram method
persistence_file=gudhi.__root_source_dir__ + \
'/data/persistence_diagram/rips_on_tore3D_1307.pers'
- diag = \
- gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file=\
- persistence_file)
- dim = 1
- # Display persistence density
- plt = gudhi.plot_persistence_density([(dim,interval) for interval in diag[dim]],
- max_plots=0, legend=True)
+ plt = gudhi.plot_persistence_density(persistence_file=persistence_file,
+ max_plots=0, dimension=1, legend=True)
plt.show()