diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2019-11-21 10:29:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-21 10:29:52 +0100 |
commit | c8a4a15a88a8db5b8824bcee6d22d552dfdfe625 (patch) | |
tree | 85c4f8baf7b96b6929e78072d60e18a5914887a1 /src/python/doc | |
parent | 445a217f4869c62888a20302491b085fbcaabd1b (diff) | |
parent | 1e3b4f6c56409dde933341701575dc105ede12db (diff) |
Merge pull request #119 from VincentRouvreau/persistence_graphical_tool_improvements
Persistence graphical tool improvements
Diffstat (limited to 'src/python/doc')
-rw-r--r-- | src/python/doc/persistence_graphical_tools_user.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/python/doc/persistence_graphical_tools_user.rst b/src/python/doc/persistence_graphical_tools_user.rst index b2124fdd..2de99252 100644 --- a/src/python/doc/persistence_graphical_tools_user.rst +++ b/src/python/doc/persistence_graphical_tools_user.rst @@ -20,6 +20,7 @@ This function can display the persistence result as a barcode: .. plot:: :include-source: + import matplotlib.pyplot as plot import gudhi off_file = gudhi.__root_source_dir__ + '/data/points/tore3D_300.off' @@ -29,7 +30,7 @@ This function can display the persistence result as a barcode: simplex_tree = rips_complex.create_simplex_tree(max_dimension=3) diag = simplex_tree.persistence(min_persistence=0.4) - plot = gudhi.plot_persistence_barcode(diag) + gudhi.plot_persistence_barcode(diag) plot.show() Show persistence as a diagram @@ -43,14 +44,15 @@ This function can display the persistence result as a diagram: .. plot:: :include-source: + import matplotlib.pyplot as plot 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' - plt = gudhi.plot_persistence_diagram(persistence_file=persistence_file, + gudhi.plot_persistence_diagram(persistence_file=persistence_file, legend=True) - plt.show() + plot.show() Persistence density ------------------- @@ -63,11 +65,12 @@ If you want more information on a specific dimension, for instance: .. plot:: :include-source: + import matplotlib.pyplot as plot 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' - plt = gudhi.plot_persistence_density(persistence_file=persistence_file, + gudhi.plot_persistence_density(persistence_file=persistence_file, max_intervals=0, dimension=1, legend=True) - plt.show() + plot.show() |