#### Persistent diagram of one-dimensional data

Mahdi Kooshkbaghi

Dear all,
It could be more conceptual issue about the topic rather than software issue.
I wonder how can I generate persistent diagrams for the scalar field via Dionysus?
I have attached the figure from "Persistent homology survey by H. E. and J. H".
I am trying to understand and plot something similar.
Thanks,
Mahdi
PS: for two and more-dimensional data I can understand and play with package to get the persistence diagrams. Dmitriy Morozov

Hi Mahdi,

Below is an example that does what you want, I think. It boils down to generating the lower-star filtration of a piecewise-linear function whose values you give as a NumPy array . The plot of the persistence diagram is missing the point at infinity, although the diagram itself (dgm) has that point.

Dmitriy

import dionysus as d
import numpy as np
import matplotlib.pyplot as plt

a = np.array([10,4,7,3,9,2,12], dtype='f4')
plt.plot(a)
plt.show()

f = d.fill_freudenthal(a)
p = d.homology_persistence(f)
dgm = d.init_diagrams(p,f)

d.plot.plot_diagram(dgm, show=True)

On Tue, Mar 20, 2018 at 2:28 PM, wrote:
Dear all,
It could be more conceptual issue about the topic rather than software issue.
I wonder how can I generate persistent diagrams for the scalar field via Dionysus?
I have attached the figure from "Persistent homology survey by H. E. and J. H".
I am trying to understand and plot something similar.
Thanks,
Mahdi
PS: for two and more-dimensional data I can understand and play with package to get the persistence diagrams. Mahdi Kooshkbaghi

Dear Dimitry,
Thank you very much. Even your short description solve my conceptual problem.
Best,
Mahdi