I want to plot two graphs out of one pandas dataframe(a), by overlapping them.
This is part of the dataframe(a).
Temperature
DateTime
2017-05-01 07:20:00 49.15
2017-05-01 07:19:00 49.14
2017-05-01 07:18:00 49.15
2017-05-01 07:17:00 49.14
2017-05-01 07:16:00 49.14
2017-05-01 07:15:00 49.15
2017-05-01 07:14:00 49.15
2017-05-01 07:13:00 49.15
2017-05-01 07:12:00 49.16
2017-05-01 07:11:00 49.17
2017-05-01 07:10:00 49.18
2017-05-01 07:09:00 49.16
2017-05-01 07:08:00 49.15
2017-05-01 07:07:00 49.15
2017-05-01 07:06:00 49.16
2017-05-01 07:05:00 49.19
2017-05-01 07:04:00 49.19
2017-05-01 07:03:00 49.20
2017-05-01 07:02:00 49.21
2017-05-01 07:01:00 49.15
Firstly, I want to plot this graph as a timeseries. Secondly, I want to plot points that meet a certain condition. For example, I want to plot each teperature that is the highest value within the range of +- 5 rows. The below shows a function that I made for this condition.
def HIGH(a, span):
for m in range(span, len(a)-span):
temp_df = a.iloc[m-span:m+span]
if a.iloc[m] == pd.DataFrame.max(temp_df, axis=0):
print(a.index.values[m])
print(a.iloc[m])
>>> HIGH(a, 5)
2017-05-01T07:10:00.000000000
49.18
>>> matplotlib.pyplot.plot(a)
>>> matplotlib.pyplot.show()
shows the graph below, but how can I mark the point(with 'rx' option)?

