Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

At first let me thank, from this point as well, those that they replied to my previous queries.

From a reply I got, I obtained finally the desired graph.

lst = {10*Cos[u]*Sin[v], 3*Sin[u]*Sin[v], 2*Cos[v]};
dam = Sqrt[(1296*Cos[u]^4*
       Sin[v]^4)/(900*Cos[v]^2 + 36*Cos[u]^2*Sin[v]^2 + 
        400*Sin[u]^2*Sin[v]^2)^2 + (3600*Cos[u]^2*
       Sin[v]^2*(9*Cos[v]^2 + 4*Sin[u]^2*Sin[v]^2))/(900*Cos[v]^2 + 
        4*(9*Cos[u]^2 + 100*Sin[u]^2)*Sin[v]^2)^2];
colFun = Function[{u, v}, Evaluate@Hue[Rescale[dam, {0, 1}]]];
{min, max} = {0, 1};
ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, 
 ColorFunction -> (colFun[#4, #5] &), ColorFunctionScaling -> False, 
 PlotRange -> All, ImageSize -> 800, 
 PlotLegends -> 
  BarLegend[{Hue, {min, max}}, ColorFunctionScaling -> True]]

Now, what I want is to check the outputs of other available color schemes.

I did the following:

coldata = ColorData["Gradients"];
col = Table[{i, coldata[[i]], ColorData[coldata[[i]]]}, {i, 51}];

So, for instance (for ColorData["BrightBands"])

{min, max} = {0, 1};
lst = {10*Cos[u]*Sin[v], 3*Sin[u]*Sin[v], 2*Cos[v]};
colFun = Function[{u, v}, Evaluate@col[[10, 3]][Rescale[dam, {0, 1}]]];
h = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, 
  ColorFunction -> (colFun[#4, #5] &), ColorFunctionScaling -> False, 
  ImageSize -> 800, 
  PlotLegends -> 
   BarLegend[{colFun, {min, max}}, ColorFunctionScaling -> True]]

The coloring of the ellipsoid is as desired, but this does not hold true for the color bar. Obviously, something I made wrong.

I really appreciate any help!

Dimitris

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.