I am trying to plot vertical lines in a line lot that I have already plotted.
Just a small portion of my data looks as follows:
EscAct_Curr_A StepID Time_Elapsed
0.122100122272968 1 0.0
0.0 2 0.101
0.0 2 0.432
0.122100122272968 2 1.422
0.122100122272968 2 2.422
0.122100122272968 2 3.422
0.122100122272968 2 4.432
0.122100122272968 2 5.938
0.122100122272968 2 6.49
0.122100122272968 5 7.928
0.122100122272968 5 8.938
0.122100122272968 5 9.938
While plotting the entire data on the graph, I use the following code:
x = data['Time_Elapsed']
y = data['EscAct_Curr_A']
plt.plot(x, y)
plt.show()
and I get the following graph:
What I want to do now is to find the minimum time of each StepID
and plot a vertical line on the graph above.
For example:
From the above data we can see that 0.0 is the minimum time for StepID 1
, so a vertical line must be drawn at 0.0 and must be named as 1, then for StepID 2
, 0.101 is the minimum time, so a vertical line at 0.101 must be drawn and must be named as 2 and so on.
I would like to know how can this be done either in matplotlib or in seaborn
Thanks