1
$\begingroup$

The documentation of ColorFunction states that in ListContourPlot3D your chosen function gets the arguments x, y, z and f. However, if you actually use any argument other than the first an error is raised in Mathematica 12.2, yet strangely enough the plot is (most of the times) shown as expected.

Consider for example

list1 = Table[{x, y, z, x^2 + y^2 - z^2}, {x, -1, 1, .05}, {y, -1, 1, .05}, {z, -1, 1, .05}]~Flatten~2;

ListContourPlot3D[list1, Contours -> {0.3}, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, ColorFunction -> Function[{x, y, z, f}, Hue[z]], ColorFunctionScaling -> False]

This produces the error

Function::fpct: Too many parameters in {x,y,z,f} to be filled from Function[{x,y,z,f},Hue[z]][0.3].

But the generated graphics seem OK: ColorFunction in ListContourPlot3D

Is this a bug, or am I doing something wrong here?

$\endgroup$
3
  • 1
    $\begingroup$ Must be a bug since ContourPlot3D[x^2 + y^2 - z^2, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, Contours -> {0.3}, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, ColorFunction -> Function[{x, y, z, f}, Hue[z]], ColorFunctionScaling -> False] is well. $\endgroup$
    – cvgmt
    Commented Mar 16, 2021 at 12:13
  • $\begingroup$ I can't reproduce that error in MMA 12.2.0 (Linux, on the cloud). What version and OS are you using? $\endgroup$
    – MarcoB
    Commented Mar 16, 2021 at 13:18
  • $\begingroup$ I'm using Mathematica 12.2.0.0 on a Windows 10 desktop PC $\endgroup$ Commented Mar 16, 2021 at 20:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.