I have the following graph:

Being Uplot the x axis and Pplot the y axis, when doing
peakPplot = np.max(Pplot)
Uplot_peak = np. interp(peakPplot, Pplot, Uplot)
print(Uplot_peak)
When I used this instead How to find the corresponding x value for a given y value in a plot I could only get the first value
Uplot_peak reported the last value within y but it is outside the graph as it is in shown
Finding the corresponding x value for a given y value within a graph