Message Boards Message Boards

Overlay 2D and 3D plots??

Posted 10 years ago

Hi I am trying to overlay p1 = ParametricPlot[r[t], {t, 0, Pi/2}] (this is the graph of an ellipse) onto p2= Plot3D[m[x, y], {x, 0, 5}, {y, 0, 5}] (A 3D graphic of a mountain range) to give a graphic that looks something like the graphic below. I tried using Show[p1,p2] but that does not work. Can someone help?enter image description here

POSTED BY: Bill Billy

It may be possible to do this with textures, but this is how I'd do this:

(*Make an example surface*)

surface = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]

(* Make a 3D curve. Its height matches the surface's *)
line = ParametricPlot3D[{x, y, Sin[x + y^2]} /. {x -> Cos[theta], 
    y -> Sin[theta]}, {theta, 0, 2 Pi}, PlotStyle -> Red]

(*Combine the results*)
Show[surface, line]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract