I have a list of data (3kB) in the form of {x,y}
. For some x
values, every x
corresponds to a single y
, for some others, every x
corresponds to $3$ different y
. Please see the following plot.
testpts = Import["~\\curves_test.dat"];
plt = ListLogPlot[testpts, PlotRange -> All, ImageSize -> 300, Frame -> True, Axes -> False]
As you may see, there are actually two curves, one of which is folding (see the orange curve in the figure below).
I would like to separate the data and interpolate them as two different smooth curves, such that I can plot them respectively. For example, this enables us to plot the two curves in different figures with Plot
and LogPlot
or with different PlotStyle
s, as illustrated in the desired results.
Notes
The data are obtained from numerical calculation. The red and orange curves do not intersect (thanks to @JimB's advice). They look very close in a range (around
2.94<x<2.99
) but actually well separated.Some parts of the data look not very smooth, thus I'd like to make them smooth somehow with appropriate interpolate functions.
I need a general approach to handle lots of data with such kind of features, thus picking out data with
Select[testpts, x1 < First@# < x2 && y1 <Last@# <y2 &]
may not be very useful :)
Any suggestions are welcome!