4

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

kglr
  • 394,356
  • 18
  • 477
  • 896
Yaroslav Bulatov
  • 7,793
  • 1
  • 19
  • 44

1 Answers1

5
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

kglr
  • 394,356
  • 18
  • 477
  • 896