diff options
Diffstat (limited to 'cython/doc/persistence_graphical_tools_user.rst')
-rw-r--r-- | cython/doc/persistence_graphical_tools_user.rst | 71 |
1 files changed, 28 insertions, 43 deletions
diff --git a/cython/doc/persistence_graphical_tools_user.rst b/cython/doc/persistence_graphical_tools_user.rst index 9033331f..292915eb 100644 --- a/cython/doc/persistence_graphical_tools_user.rst +++ b/cython/doc/persistence_graphical_tools_user.rst @@ -1,49 +1,26 @@ +:orphan: + +.. To get rid of WARNING: document isn't included in any toctree + Persistence graphical tools user manual ======================================= Definition ---------- -.. include:: persistence_graphical_tools_sum.rst - - -Show palette values -------------------- - -This function is useful to show the color palette values of dimension: - +.. include:: persistence_graphical_tools_sum.inc -.. testcode:: - - import gudhi - plt = gudhi.show_palette_values(alpha=1.0) - plt.show() - -.. plot:: - - import gudhi - plt = gudhi.show_palette_values(alpha=1.0) - plt.show() Show persistence as a barcode ----------------------------- This function can display the persistence result as a barcode: -.. testcode:: - - import gudhi - - periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \ - '/data/bitmap/3d_torus.txt') - diag = periodic_cc.persistence() - plt = gudhi.plot_persistence_barcode(diag) - plt.show() - .. plot:: + :include-source: import gudhi - periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \ - '/data/bitmap/3d_torus.txt') + 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) @@ -54,24 +31,32 @@ Show persistence as a diagram This function can display the persistence result as a diagram: -.. testcode:: +.. plot:: + :include-source: import gudhi - - rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/tore3D_1307.off', max_edge_length=0.2) - simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) - diag = simplex_tree.persistence() - plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13) + + # 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' + plt = gudhi.plot_persistence_diagram(persistence_file=persistence_file, + legend=True) plt.show() +If you want more information on a specific dimension, for instance: + .. plot:: + :include-source: import gudhi - rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \ - '/data/points/tore3D_1307.off', max_edge_length=0.2) - simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) - diag = simplex_tree.persistence() - plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13) + 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 all points with some transparency + plt = gudhi.plot_persistence_diagram([(dim,interval) for interval in diag[dim]], + max_plots=0, alpha=0.1) plt.show() |