# How does the Contours→{{f_1, g1}, {f_2, g_2}, …} setting work?

I want to plot some wavefronts in Mathematica, and I'm having some trouble reining in one of the options for my ContourPlot3D.

More specifically, the documentation for ContourPlot3D says that the Contours option can be used in the form

ContourPlot3D[
x^3 + y^2 - z^2
, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}
, Contours -> {{-2, Red}, {2, Blue}}
, Mesh -> None
]


to produce contours at those levels and with those colours, but when I try to implement that I get some pretty wonky behaviour. As a minimal example, consider the following plane wave:

L = π + 0.001;
ContourPlot3D[
Arg[Exp[I z]]
, {x, -L, L}, {y, -L, L}, {z, -L, L}
, Contours -> Table[{ϕ, Hue[(ϕ + π)/(2 π)]}, {ϕ, -π, π, π/3}]
, Mesh -> None
]


Unfortunately, it produces some pretty paltry output, with a bunch of contours missing. Weirdly enough, these contours do appear if I give it numerical values for the contours:

ContourPlot3D[
Arg[Exp[I z]]
, {x, -L, L}, {y, -L, L}, {z, -L, L}
, Contours -> Table[{N[ϕ], Hue[(ϕ + π)/(2 π)]}, {ϕ, -π, π, π/3}]
, Mesh -> None
] What's going on here? Is this a bug?

• Well, this doesn't work right, either (dropping Hue): ContourPlot3D[Arg[Exp[I z]], {x, -L, L}, {y, -L, L}, {z, -L, L}, Contours -> Table[\[Phi], {\[Phi], -\[Pi], \[Pi], \[Pi]/3}], Mesh -> None] – Michael E2 Jul 21 '16 at 19:44
• @Michael Huh, I just skipped that step. Yeah, that's some buggy behaviour right there. – Emilio Pisanty Jul 21 '16 at 19:46
• Part of the problem is that  Arg[Exp[I z]] is discontinuous over the interval {z, -L ,L} and jumps over several contours near ±L. That's probably confusing the mesher. – Michael E2 Jul 21 '16 at 19:52
• @JasonB That does seem like a bug, since Contours -> {N@\[Pi]/3} works fine. – Michael E2 Jul 21 '16 at 19:53
• I'm gonna report this internally, but it doesn't really seem to be related to the form {val,_color} or to the Arg function. Compare the output of ContourPlot3D[z, {x, -1, 1}, {y, -1, 1}, {z, 0, 5}, Contours -> N /@ {\[Pi], E, EulerGamma}] to ContourPlot3D[z, {x, -1, 1}, {y, -1, 1}, {z, 0, 5}, Contours -> {\[Pi], E, EulerGamma}] – Jason B. Jul 21 '16 at 19:53