Suppose that we have a list of points. By plotting them we find two curves but the points are in a sequence of first fixing $x$ and then increasing $y$, next fixing $x+dx$ and then increasing $y$ and so on. In order words, the points of the two curves are mixing and scrambling, as seen from ListLinePlot
.
testdata = (*copy & paste the data in .txt*);
{ListPlot[testdata, Frame -> True, PlotRange -> {{0, 4}, {0, 2.3}}, ImageSize -> 400],
ListLinePlot[testdata, Frame -> True, PlotRange -> {{0, 4}, {0, 2.3}}, ImageSize -> 400]}
Such data is obtained from a big NSolve
code, which seems to be impossible to change the order of data generating in the code. Generally, I need to separate them into two groups for the two curves and re-order them along the curves from a start point (indicated by a circle in the following figure), for example, see the figure.
How can I implement the procedure to separate and re-order them. Thank you in advance!