I have data from similar function that are not evaluated on the same points. I would like to plot the points and the curves that are the upper and lower bounds of them. As an example consider the following code:
f[x_, r1_, r2_] := 1/((x + (2 r1 - 1)/2)^2 + r2 + 1)
SeedRandom[3]
points = {};
rs = Table[{RandomReal[], RandomReal[]}, {20}];
Do[
p = RandomReal[{-2, 2}, {50}];
v = f[#, rs[[i, 1]], rs[[i, 2]]] & /@ p;
points = Join[points, Transpose[{p, v}]];
, {i, 20}]
points = RandomSample[points];
The ListPlot
of these points is:
Clearly, in this example since we know the functions that create the points it is easy to get the upper and lower bounds:
But if we know only the points, is there any easy way to get these curves (or some others that are relatively close to those)?
points
has some entries that depend on the symbolr1
, which isn't defined. $\endgroup$