Through code:
f[{x_, y_, z_}] = x^4 + y^4 + z^4;
r[t_] = {1/3 + 1/3 Cos[t] - 1/Sqrt[3] Sin[t],
1/3 + 1/3 Cos[t] + 1/Sqrt[3] Sin[t],
1/3 - 2/3 Cos[t]};
{min, max} = {0, 2 Pi};
ParametricPlot3D[
r[t],
{t, min, max},
ColorFunction -> Function[t,
ColorData["Rainbow"][f[r[t]]]],
AxesLabel -> {x, y, z},
BoxRatios -> {1, 1, 1},
PlotLegends -> BarLegend[{"Rainbow",
{MinValue[{f[r[t]], min <= t <= max}, t],
MaxValue[{f[r[t]], min <= t <= max}, t]}}]]
I get:
which it is certainly not what you want, because through this other code:
f[x_, y_, z_] = x^4 + y^4 + z^4;
A = ImplicitRegion[x^2 + y^2 + z^2 <= 1 && x + y + z <= 1, {x, y, z}];
SliceDensityPlot3D[
f[x, y, z],
BoundaryDiscretizeRegion[A],
{x, y, z} \[Element] DiscretizeRegion[A],
ColorFunction -> "Rainbow",
AxesLabel -> Automatic,
PlotLegends -> Automatic]
I get:
where the colors are very clear that it must be expected on the circumference above.
Where am I wrong?
ColorFunctionScaling -> False
) $\endgroup$SetDelayed
if you define variables as patterns:f[x_,y_,z_]:=...
$\endgroup$