# Placing a ContourPlot under a Plot3D

**URL:** <https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965>\
**Category:** Staff Picks\
**Tags:** graphics-and-visualization, staff-pick\
**Created:** [July 18, 2017, 5:33pm UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965 "2017-07-18T17:33:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vitaliyk](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/vitaliyk/32/45591_2.png) [@Vitaliyk](https://community.wolfram.com/u/Vitaliyk)\
**Post date:** [July 18, 2017, 5:33pm UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/1 "2017-07-18T17:33:30Z")

</div>

![PlacingaContourPlotunderaPlot3D.jpg](https://global.discourse-cdn.com/wolfram/original/3X/f/2/f255cd9c982aebc23b1904bf94383b4908addc88.jpeg)

Placing a ContourPlot under a Plot3D could be a useful visualization. One strategy is quite simple: texture-map 2D plot on a rectangle under your 3D surface. I took a liberty with some styling that I like - you can always come back to yours.

```
contourPotentialPlot1 = ContourPlot[-3600. h^2 + 0.02974 h^4 - 5391.90 s^2 + 
   0.275 h^2 s^2 + 0.125 s^4, {h, -400, 400}, {s, -300, 300}, 
 PlotRange -> {-1.4*10^8, 2*10^7}, Contours -> 15, Axes -> False, 
 PlotPoints -> 30, PlotRangePadding -> 0, Frame -> False, ColorFunction -> "DarkRainbow"];

potential1 = Plot3D[-3600. h^2 + 0.02974 h^4 - 5391.90 s^2 + 0.275 h^2 s^2 + 
    0.125 s^4, {h, -400, 400}, {s, -300, 300}, 
   PlotRange -> {-1.4*10^8, 2*10^7}, ClippingStyle -> None, 
   MeshFunctions -> {#3 &}, Mesh -> 15, MeshStyle -> Opacity[.5], 
   MeshShading -> {{Opacity[.3], Blue}, {Opacity[.8], Orange}}, Lighting -> "Neutral"];

level = -1.2 10^8; gr = Graphics3D[{Texture[contourPotentialPlot1], EdgeForm[], 
Polygon[{{-400, -300, level}, {400, -300, level}, {400, 300, level}, {-400, 300, level}}, 
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, Lighting -> "Neutral"];

Show[potential1, gr, PlotRange -> All, BoxRatios -> {1, 1, .6}, FaceGrids -> {Back, Left}]

```

 ![13631.jpg](https://global.discourse-cdn.com/wolfram/original/3X/a/f/af220ac7d9dcf8d21801487cd8000a251eeea537.jpeg)

You can see I used `PlotRangePadding -> 0` option in `ContourPlot`. It is to remove white space around the graphics to make texture mapping more precise. If you need utmost precision you can take another path. Extract graphics primitives from `ContourPlot` and make them 3D graphics primitives. If you need to color the bare contours - you could replace `Line` by `Polygon` and do some tricks with `FaceForm` based on a contour location.

```
level = -1.2 10^8;
pts = Append[#, level] & /@ contourPotentialPlot1[[1, 1]];
cts = Cases[contourPotentialPlot1, Line[l_], Infinity];
cts3D = Graphics3D[GraphicsComplex[pts, {Opacity[.5], cts}]];

Show[potential1, cts3D, PlotRange -> All, BoxRatios -> {1, 1, .6}, 
 FaceGrids -> {Bottom, Back, Left}]

```

 ![43692.png](https://global.discourse-cdn.com/wolfram/original/3X/1/6/16665a2f8df37d23582f9b320d36df33c34945da.png)

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [July 18, 2017, 7:08pm UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/2 "2017-07-18T19:08:48Z")

</div>

Here’s an alternative way in which the “contour plot” takes its contours styling directly from the plot and its mesh lines (which need to be from `MeshFunctions -> {#3 &}`):

```
Show[
 potential1,
 DeleteCases[
  potential1 /. GraphicsComplex[pts_, rest___] :>
    GraphicsComplex[
     PadRight[pts[[All, ;; 2]], {Automatic, 3}, 
      Rescale[PlotRange[potential1][[3]], (* the whole Rescale[..] code can be replaced by any number/level *)
        {0, 1},
        {-0.05, 1} (* project 5% lower than original plot range - change as desired *)
        ][[1]]],
     rest],
  Verbatim[Rule][VertexNormals, _], Infinity],
 PlotRange -> All]

```

 ![25901Example.png](https://global.discourse-cdn.com/wolfram/original/3X/0/f/0f948fb1eb25371acedb9a8f6b1fa6d767676b19.png)

---

<div class="post-metadata">

**Author:** ![christospapahristodoulou](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/christospapahristodoulou/32/20809_2.png) [@christospapahristodoulou](https://community.wolfram.com/u/christospapahristodoulou)\
**Post date:** [August 2, 2017, 7:30am UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/3 "2017-08-02T07:30:48Z")

</div>

Vitaliy & Michael,  
Thanks very much for your excelent suggestions! I am very gratefull!  
Christos

---

<div class="post-metadata">

**Author:** ![binoushousam](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/binoushousam/32/2533_2.png) [@binoushousam](https://community.wolfram.com/u/binoushousam)\
**Post date:** [November 1, 2025, 9:21am UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/4 "2025-11-01T09:21:36Z")

</div>

thank you very much for sharing this code!

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [November 1, 2025, 7:22pm UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/5 "2025-11-01T19:22:10Z")

</div>

Another way, using `Scale`:

```
Show[potential1,
 Graphics3D[Scale[potential1[[1]],
   {1, 1, 0}, {0, 0, -2*10^8}]],
 PlotRange -> All]

```

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [November 4, 2025, 4:34pm UTC](https://community.wolfram.com/t/placing-a-contourplot-under-a-plot3d/10965/6 "2025-11-04T16:34:46Z")

</div>

![news-congrads-kkluyshnik-02-04-19.jpg](https://global.discourse-cdn.com/wolfram/original/3X/6/a/6a310c2d0904616faf4e6e148260c9f29ab9f4eb.jpeg) – you have earned _ **Featured Contributor Badge** _ ![2015-11-02_10-07-11.png](https://global.discourse-cdn.com/wolfram/original/3X/5/0/50e59c9ead62f729e7130d3ea1482555a75602b6.png)  
Your exceptional post has been selected for our editorial column _ **Staff Picks** _ [http://wolfr.am/StaffPicks](http://wolfr.am/StaffPicks) and [Your Profile](http://community.wolfram.com/web/vitaliyk) is now distinguished by a _ **Featured Contributor Badge** _ and is displayed on the [Featured Contributor Board](https://community.wolfram.com/people). Thank you!
