Skip to content

Commit

Permalink
udpate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Oct 26, 2023
1 parent 4c3215f commit 83226b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions findpeaks/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# print(findpeaks.__version__)

# pip install opencv-python
# import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
# from findpeaks import findpeaks
# %%

Expand All @@ -16,16 +16,16 @@
path = r'https://user-images.githubusercontent.com/12035402/274193739-cdfd8986-91eb-4211-bef6-ebad041f47ae.png'
fp = findpeaks(method='topology', denoise='lee_sigma', params={'window': 5}, whitelist='peak', limit=5)
X = fp.imread(path)
# X = fp.import_example('2dpeaks_image')
results = fp.fit(X)

result_df = results['persistence']
peak = result_df.index[result_df['peak']==True].tolist()
print(result_df.loc[peak])
print(result_df.shape)
fp.plot_persistence()
fp.plot(figsize=(35, 16), text=False, marker='x', color='r')
fp.plot_mesh(view=(90, 0))
fp.plot(figsize=(25, 14), text=False, marker='x', color='#ff0000', figure_order='vertical')
# fp.plot_mesh(cmap=plt.cm.hot, view=(40, 180))
# fp.plot_mesh(view=(90, 0))

# %%
# Import library
Expand Down

0 comments on commit 83226b0

Please sign in to comment.