How to define the peaks of a graph?

Here is the graph of which I would like to determine the peaks. When I’ve done that, I would like to connect the dots. However I have no clue how to actually make this happen. Below is the code I currently have, but it sets markers all across my line graph from the first picture. Please help!


Hi @joziask, I think I answered a similar question some time ago:

How do you define a peak, that would be the question.

Scipy has actually module for peak detection:

A first search on stackoverflow shows some example usages:

Unfortunately it does not work yet. I’ve created an array of the values in my graph, but I get the following error.

Hi @joziask , what’s the shape of value_array? Try axis=0.