I have a parametric funtion say, (f(t) cos t, f(t) sin t) and another function g(t). Now I want to plot (f(t) cos t, f(t) sin t) and show g(t) in bar legend for same range of t. for example t=0.5 corresponds to same color in g(t) bar and the plot. Is there any way to do it?
Here is a simple example code,
f[t_] := t + 1
g[t_] := t^3 + 3*t + 12
ParametricPlot[{f[t]*Cos[\[Theta]], f[t]*Sin[\[Theta]]}, {t, 0, 1}, {\[Theta], 0, 2*Pi}, ColorFunction -> Function[{x, y, t}, ColorData["SolarColors"][Rescale[g[t], {g[0], g[1]}, {0, 1}]]]
This give the following figure,
The figure is ok, but i want to show g[t]
in bar legend for the same range of t. Is there any way?
ParametricPlot
and the corresponding optionColorFunction
. Try it yourself, then edit the question and include the code if you encounter any problems. $\endgroup$Show
function as follows:Show[{ParametricPlot[body], Plot[g[t],{t,t1,t2},PlotStyle->White, PlotLegends...]}]
In this case, the plot of the function g(t) will not be visible, but its legend will still appear. Hope I understood your problem correctly, and it helps. $\endgroup$