Persistence 1D incl. Reconstruct1D  1.3
Finding extrema in one dimensional data, filtering them by persistence and reconstructing smooth functions
visualize.py
Go to the documentation of this file.
1 import matplotlib.pyplot as plt
2 import numpy as np
3 
4 marker_style = dict(linestyle='', color='0.8', markersize=10, mfc="C0", mec="C0")
5 
6 # Data for plotting
7 data = np.genfromtxt("data.txt", delimiter=',', dtype=None)
8 features = np.genfromtxt("res.txt", delimiter=',', dtype=None)
9 
10 fig, ax = plt.subplots()
11 ax.plot(range(0, len(data)), data)
12 
13 ax.plot(features, data[features], marker='.', **marker_style)
14 
15 ax.set(xlabel='data index', ylabel='data value')
16 ax.grid()
17 
18 fig.savefig("MatplotlibVisRes.png")
19 plt.show()