in reply to Re: How would you code this?
in thread How would you code this?

what about simply removing lines where X is going down compared to previous values?

That doesn't achieve the requirement of strict monotonicity (is that a real word? :). Ie. it produces runs of points with different Y-values and the same x-value:

03 0.0037064 0.4124646 04 0.0037064 0.4216399 05 0.0037166 0.4351084 06 0.0037166 0.4438854 07 0.0037268 0.4518142 08 0.0037268 0.4628417 09 0.0037370 0.4730210 10 0.0037370 0.4832176 11 0.0037370 0.4894152

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: How would you code this?
by Laurent_R (Canon) on Apr 07, 2016 at 16:25 UTC
    Yeah, I realized that, but did not know whether it was important. But that's why I also said that you could remove duplicate X values if needed:
    You might also change the relevant code line to:
    next if $x <= $previous_x;
    if you want to remove duplicate X values.