Apologies for the vague title; couldn't really think of a better way of putting it.
I have a function $F$ of two variables, $\rho\in[0,\infty)$ and $f\in[0,1]$, that I wish to create a plot over (e.g. with CountourPlot
or DensityPlot
). I can numerically generate the entire curve of $F$ over $f$ for a particular value of $\rho$ relatively cheaply, but I can't directly compute $F$ for individual values of $f$.
Is there an efficient way of taking such a curve and plotting it for a range of $\rho$ without Mathematica having to evaluate the function independently at every $(\rho,f)$?
Here's how I compute $F$:
Lorentz[data_] := Module[{xs, ys},
xs = Range[0, Length[data]];
ys = Prepend[Accumulate[Sort[data]], 0];
Transpose[{xs/Last@xs, ys/Last@ys}]];
L = Interpolation[Lorentz[data], InterpolationOrder -> 1];
F = 1 - L[1 - #] &;
data
is a list of real numbers generated according to the value of $\rho$.
Essentially, I generate a Lorentz curve numerically as a list of $(x,y)$ tuples, turn it into a function via Interpolation
, reflect it a couple of times, and that's my function $F$.