# ContourPlot3D graph issues

I am attempting to see the contour plot for the function, Sqrt[y-x]==z. The graph shows an odd structure that seems to fall where a vertical asymptote would exist. What can I do to eliminate the odd structure? Here is my code for it:

ContourPlot3D[Sqrt[y-x]==z,{x,-6,6},{y,0,6},{z,0,4}]


and here is the result:

• ContourPlot3D[Re[Sqrt[y - x]] == z, {x, -6, 6}, {y, 0, 6}, {z, 0, 4}, AxesLabel -> Automatic] Commented Dec 22, 2022 at 15:34
• Thanks Bob. I am fairly new to Mathematica. I knew there was a real number issue just by what was going on in the graph. I was unaware that adding the Re would only allow real number output. This helps tremendously. Commented Dec 22, 2022 at 16:41
• @BobHanlon ContourPlot3D[Re[Sqrt[y - x]] == z, {x, -6, 6}, {y, 0, 6}, {z, -4, 4}, AxesLabel -> Automatic] will get the wrong result. The result contain a part of z==0 and y<=x. Commented Dec 23, 2022 at 1:42

It is a bug.

we have to remove Sqrt from the original equation.

ContourPlot3D[y - x == z^2, {x, -6, 6}, {y, 0, 6}, {z, 0, 4}]


Or

ContourPlot3D[y - x == z^2, {x, -6, 6}, {y, 0, 6}, {z, -4, 4},
RegionFunction -> Function[{x, y, z}, z >= 0],
RegionBoundaryStyle -> None]


Or use ImplicitRegion, still avoid Sqrt.

reg = ImplicitRegion[{y - x == z^2,
z >= 0}, {{x, -6, 6}, {y, 0, 6}, {z, -4, 4}}]
RegionPlot3D[DiscretizeRegion@reg, Axes -> True, BoxRatios -> 1,
Mesh -> 10]


• I must have accidently hit a downvote a day or so ago from my iPhone . I just now corrected it to an upvote. Sorry about that.
– JimB
Commented Dec 24, 2022 at 0:37
• @JimB Thanks :) Commented Dec 24, 2022 at 1:12