diff options
author | tlacombe <lacombe1993@gmail.com> | 2020-03-03 16:57:56 +0100 |
---|---|---|
committer | tlacombe <lacombe1993@gmail.com> | 2020-03-03 16:57:56 +0100 |
commit | 4f4030e9f9e0215c2d1f2431c02cd9270bba2699 (patch) | |
tree | ddfb07e68eb673326167730a3e045db990c5ce09 /src/python/doc/persistence_graphical_tools_user.rst | |
parent | efae8ff48c6b6e4d29afea753b7a1ddee0925ad4 (diff) |
updated doc and example handling Nx2 numpy arrays
Diffstat (limited to 'src/python/doc/persistence_graphical_tools_user.rst')
-rw-r--r-- | src/python/doc/persistence_graphical_tools_user.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/python/doc/persistence_graphical_tools_user.rst b/src/python/doc/persistence_graphical_tools_user.rst index ff51604e..91e52703 100644 --- a/src/python/doc/persistence_graphical_tools_user.rst +++ b/src/python/doc/persistence_graphical_tools_user.rst @@ -57,6 +57,18 @@ This function can display the persistence result as a diagram: ax.set_aspect("equal") # forces to be square shaped plt.show() +Note that (as barcode and density) it can also take a simple `np.array` +of shape (N x 2) encoding a persistence diagram (in a given dimension). + +.. plot:: + :include-source: + + import matplotlib.pyplot as plt + import gudhi + import numpy as np + d = np.array([[0, 1], [1, 2], [1, np.inf]]) + gudhi.plot_persistence_diagram(d) + plt.show() Persistence density ------------------- |