[Mathematica] Combining several Graphics in a Graphics3D

  • Context: Mathematica 
  • Thread starter Thread starter guerom00
  • Start date Start date
  • Tags Tags
    Graphics Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 4K views
guerom00
Messages
90
Reaction score
0
Hello all,

I'll try to make myself clear... My goal here is to plot a function f(x,y) in 3D. But, instead of using the Plot3D[] function, I made a table of Plot[] for, say, several values of the x variable.
So I'm now with a list which looks like this :
{{x1,Plot[f[x1,y],{y,ymin,ymax}]},{x2,Plot[f[x2,y],{y,ymin,ymax}]},...}
So a list whose elements are a list of a real number (the xi's) and a Graphics object (the Plot[]'s).
My question is now how to combine all of this in a Graphics3D object which would represent the 3D graph of my f(x,y) function.

Thanks in advance. :)
 
Physics news on Phys.org
In older version of Mma, I don't know about the most recent ones, there was a command in Graphics'Graphics3D' named StackGraphics that could pile up Plots but I don't recall the possibility to put them at specific abscissas.

If you wish and are able to just generate the data points (losing all of Plot's useful beautifying tricks), here's a procedure I found in an old notebook of mine. I believe I took it from Bahder's book "Mathematica for Scientists and Engineers"

Code:
LinePlot3D[data_, opts___] := Show[Graphics3D[Line /@ data, opts]]

Example use
Code:
z[x_,y_]:=Exp[-3. (y-4.)^2]+.5  Exp[-18. (y-3.5-0.5x)^2]

f[x_]:=Table[{y,z[x,y]},{y,1,8,0.05}]
f3[x_]:=f[x] /. {y_,f_} :>    {x,y,f}
data=Table[f3[x],{x,1,6,0.4}];

LinePlot3D[data,ViewPoint->{3.188, -0.755, 0.845},
  PlotRange->{{1,6},{1,8},{0,2}}]

Otherwise, I'll redirect you to David Park's package (via google), but I'm not sure it's still free of charge.
 
Thanks for your answer. StackGraphics[] does work and does what I want although it lacks basic options...