summaryrefslogtreecommitdiff
path: root/src/python/doc
diff options
context:
space:
mode:
authortlacombe <lacombe1993@gmail.com>2020-03-03 16:57:56 +0100
committertlacombe <lacombe1993@gmail.com>2020-03-03 16:57:56 +0100
commit4f4030e9f9e0215c2d1f2431c02cd9270bba2699 (patch)
treeddfb07e68eb673326167730a3e045db990c5ce09 /src/python/doc
parentefae8ff48c6b6e4d29afea753b7a1ddee0925ad4 (diff)
updated doc and example handling Nx2 numpy arrays
Diffstat (limited to 'src/python/doc')
-rw-r--r--src/python/doc/persistence_graphical_tools_sum.inc2
-rw-r--r--src/python/doc/persistence_graphical_tools_user.rst12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/python/doc/persistence_graphical_tools_sum.inc b/src/python/doc/persistence_graphical_tools_sum.inc
index 2ddaccfc..ef376802 100644
--- a/src/python/doc/persistence_graphical_tools_sum.inc
+++ b/src/python/doc/persistence_graphical_tools_sum.inc
@@ -2,7 +2,7 @@
:widths: 30 50 20
+-----------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------+
- | .. figure:: | These graphical tools comes on top of persistence results and allows | :Author: Vincent Rouvreau |
+ | .. figure:: | These graphical tools comes on top of persistence results and allows | :Author: Vincent Rouvreau, Theo Lacombe |
| img/graphical_tools_representation.png | the user to display easily persistence barcode, diagram or density. | |
| | | :Introduced in: GUDHI 2.0.0 |
| | Note that these functions return the matplotlib axis, allowing | |
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
-------------------