I need to find peaks and troughs in a dataset and then draw horizontal lines on a graph.
Starting with a trough at the top, hjow do I find the next peak, then trough, then peak?
Starting with a trough at the top, hjow do I find the next peak, then trough, then peak?
Code:
2112 3739900.0
2111.5 0.0
2111 40477000.0
2110.5 36991400.0
2110 47048700.0
2109.5 29540100.0
2109 10913400.0
2108.5 34449400.0
2108 205151504.0
2107.5 68120800.0
2107 72696300.0
2106.5 266594600.0
2106 85799700.0
2105.5 110162300.0
2105 195678904.0
2104.5 77769900.0
2104 38941800.0
2103.5 55083200.0
2103 60785700.0
2102.5 111992400.0
2102 273232604.0
2101.5 74710100.0
2101 126955200.0
2100.5 213616000.0
2100 111807000.0
2099.5 74419200.0
2099 74671300.0
2098.5 73661200.0
2098 53189400.0
2097.5 189451500.0
2097 40384400.0
2096.5 41221800.0
2096 226907200.0
2095.5 63465900.0
2095 54453500.0
2094.5 37356900.0
2094 28794400.0
2093.5 51220700.0
2093 30095500.0
2092.5 205854908.0
2092 20000300.0
2091.5 6395900.0
2091 159627204.0
2090.5 6859800.0
2090 22735400.0
2089.5 3731200.0
2089 11287200.0
2088.5 11990900.0
2088 31076900.0
2087.5 58287700.0
2087 47212400.0
2086.5 83859800.0
2086 67156800.0
2085.5 70703400.0
2085 66689600.0
2084.5 83639500.0
2084 102453800.0
2083.5 83306100.0
2083 75943700.0
2082.5 61760100.0
2082 261906500.0
2081.5 67219200.0
2081 215789300.0
2080.5 365248800.0
2080 38651500.0
2079.5 56484000.0
2079 34411200.0
2078.5 34306600.0
2078 30620400.0
2077.5 28018900.0
2077 16706800.0
2076.5 118554996.0
2076 66922400.0
2075.5 28401400.0
2075 9248600.0
2074.5 18630600.0
2074 5535300.0
2073.5 0.0
2073 0.0
2072.5 0.0
2072 0.0
2071.5 11298800.0
2071 5780300.0
2070.5 7013900.0
2070 25018200.0
2069.5 13329300.0
2069 11132100.0
2068.5 38949000.0
2068 19744200.0
2067.5 24212200.0
2067 218693304.0
2066.5 27039300.0
2066 10147400.0
2065.5 39206600.0
2065 10734500.0
2064.5 2513700.0
2064 5053000.0
2063.5 3244900.0
2063 3480800.0
2062.5 6290000.0
2062 6462000.0
2061.5 42252700.0
2061 0.0
2060.5 0.0
2060 8165500.0
2059.5 0.0
2059 0.0
2058.5 0.0
2058 0.0
2057.5 0.0
2057 0.0