In versions 10.2+, you can use SlicedContourPlot3D
potential1 = Plot3D[x + y - x y, {x, -5, 5}, {y, -5, 5},
ClippingStyle -> None, Mesh -> None, ColorFunction -> (ColorData["Rainbow"][#3] &),
PlotStyle -> Directive[Opacity[0.9]], PlotTheme -> "Detailed"];
We can use PlotRange[potential1]
to get the x, y, and z ranges.
zrange = PlotRange[potential1][[-1]];
contours = SliceContourPlot3D[x + y - x y, z == zrange[[1]],
{x, -5, 5}, {y, -5, 5}, {z, zrange[[1]], zrange[[2]]},
Contours -> 15, PlotPoints -> 50, ColorFunction -> "TemperatureMap"];
Show[potential1, contours,
ImageSize -> 500, Lighting -> "Neutral",
PlotRange -> All, BoxRatios -> {1, 1, .6},
FaceGrids -> {Back, Left}, ViewPoint -> {4, -4, 2}]
Update:
I need ContourPlot3D be transparent, Only curves appear
Use ContourShading -> None
(and remove ColorFunction-> "TemperatureMap"
) in SliceContourPlot3D
to get
If I changed range of x,y∈[0,1] does not give the desired result
This is what I get when I use {x, 0, 1}
and {y, 0, 1}
in both Plot3D
and SliceContourPlot3D
: