|
From: Ethan A M. <eam...@gm...> - 2018-10-18 19:08:53
|
On Thursday, 18 October 2018 20:45:18 theozh wrote: > Hi, > I would like to find the x-value of some data when its y-value passes a certain threshold. Not clear. Do you want one of these? 1) a list of all x values for which y(x) > threshold 2) an interpolated y value for each pair of x, x+1 where y(x) and y(x+1) are on opposite sides of the threshold 3) only the leading edge where y(x) < threshold and y(x+1) > threshold > The curves can be very different, so I think that fitting to a certain function is probably not a solution. > I know gnuplot is probably not made for that and other tools should be used. However, sometimes it is very convenient if there is a pure gnuplot solution. > The basic idea is: > Subtracting the threshold from the data, take the square of this and look for the minimum. I doubt that is what you really want. It answers yet another question: 4) for what x values is y(x) closer to threshold than both y(x-1) and y(x+1)? Solutions to that do not necessarily involve crossing the threshold value at all. > Maybe, I am trying way too complicated? If there are better ways please let me know. It depends on what do you want to do with a value when you find it. Do you need all points that satisfy your criterion or would any single point suffice? Ethan -- |