0
$\begingroup$

In v10.0.2, compare the following two outputs:

Plot3D[x^2 + y^2, {x, -2, 2}, {y, -2, 2}, ColorFunction -> (Hue[Sqrt[#1^2 + #2^2]] &)]

wrong output

Plot3D[x^2 + y^2, {x, -2, 2}, {y, -2, 2}, ColorFunction -> (Hue[Sqrt[#1^2 + #2^2]] &), 
ColorFunctionScaling -> False]

right output

The second output is right, however, in any sense, the first output should have rotational symmetry with respect to z axes at the origin.

Is this a bug or do I make a huge mistake?

$\endgroup$
1
$\begingroup$

The behavior you see is not a bug. It's because the default ColorFunctionScaling puts the arguments of the ColorFunction into the range 0 to 1. By using ColorFunctionScaling -> False you suppress this default scaling and get the rings centered at the minimum. With default ColorFunctionScaling, you would have to do the following:

 Plot3D[x^2 + y^2, {x, -2, 2}, {y, -2, 2}, 
  ColorFunction -> (Hue[Sqrt[(#1 - .5)^2 + (#2 - .5)^2]] &)]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks. I misundertood ColorFunctionScaling to be the one to rescale function's return value such as f[...] in Hue[f[...]] into the range 0 to 1. $\endgroup$ – luyuwuli Apr 7 '15 at 2:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.