I have a function $f(x)$ that takes some time to evaluate. It's straightforward to plot but I'd also like to plot it as a function of y where, let's say, $y=\sin(x)$.
When I try Plot[f[Sin[x]],{Sin[x],lowlim,hilim}]
Mathematica re-evaluates the function with the argument $\sin(x)$, which takes a while and doesn't give the right answer anyway. (The limits are right at least!)
Other things I've tried: With[{y=Sin[x]},Plot[f[y],{y,lolim,hilim}]]
but I get the Tag Protected error. The slash dot rule /.y->Sin[x]
yielded nothing. I also tried Block[{y=Sin[x]},Plot[f[y],{etc}]]
and I get the raw object can't be used as an iterator error.
I'm sure the solution must be really simple but I just haven't found it myself yet. Essentially, I just want to scale the dependent variable axis without re-evaluating the function.
Table
for example) and, further, plot it byListPlot
. So, you can re-run the plotting routing for some correction of the curve view without re-evaluation of the function. $\endgroup$Plot[f[Sin[x]],{x,xLowlim,xHilim}]
. You need to set the limits forx
since this is what you are integrating over. $\endgroup${x, ArcSin[lowlim], ArcSin[hilim]}
gives you an idea of the problem... $\endgroup$f[x]
, 2) Interpolate the datafi[x]
, 3) plotfi[sin[x]]
. $\endgroup$