4
$\begingroup$

This question already has an answer here:

I'm trying to put a 2D plot (ContourPlot) into a 3D plot.

I started by adapting my recipe from 8 years ago but I'm finding it to be quite user unfriendly/hard to use. For one, it's using Rasterize so additional tweaking is needed to get rid of blurriness. I'm wondering if I'm missing some features added in the last 8 years that would make this task easier to accomplish.

More specifically, I'm trying to put a 2D region plot on the top face of the bounding box of the following 3D region plot

RegionPlot[x^2 + y^2 > 1, {x, -2, 2}, {y, -2, 2}, 
 BoundaryStyle -> Dashed, PlotStyle -> Directive[Opacity[0.1]]]
RegionPlot3D[
 z < Exp[-x^2 - y^2] && x^2 + y^2 > 1, {x, -2, 2}, {y, -2, 2}, {z, 0, 
  1}]

enter image description here

$\endgroup$

marked as duplicate by N.J.Evans, george2079, aardvark2012, m_goldberg, MarcoB Dec 13 '17 at 17:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5
$\begingroup$
rp3d = RegionPlot3D[z < Exp[-x^2 - y^2] && x^2 + y^2 > 1, 
  {x, -2, 2}, {y, -2, 2}, {z, 0, 1}, PlotPoints -> 100, MaxRecursion -> 5];

scp3d = SliceContourPlot3D[x^2 + y^2, {"ZStackedPlanes",{1}}, 
  {x, -2, 2}, {y, -2, 2}, {z, 0, 1}, Contours -> {1}, 
  ContourStyle -> Directive[Dashed, Blue], BoundaryStyle -> Directive[Dashed,Blue], 
  ContourShading -> {Directive[Opacity[.3], Blue], Opacity[0]}];

Show[rp3d, scp3d]

enter image description here

$\endgroup$
  • $\begingroup$ Nice, looks like SliceContourPlot3D is this new feature added in last 8 years :) $\endgroup$ – Yaroslav Bulatov Dec 13 '17 at 1:14
  • $\begingroup$ @Yaroslav, it is less than 3 years old:) Thank you for the accept. $\endgroup$ – kglr Dec 13 '17 at 1:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.