Mathematica [Mathematica] Combining several Graphics in a Graphics3D

AI Thread Summary
The discussion focuses on combining multiple 2D plots into a single 3D graphic in Mathematica. The user has created a list of plots for different x-values and seeks guidance on how to merge these into a Graphics3D object. They mention the older StackGraphics function, which could stack plots but lacked the ability to position them at specific x-coordinates. An alternative method provided involves generating data points and using a custom LinePlot3D function to create the desired 3D representation. The user also references David Park's package for additional functionality, although its current availability is uncertain.
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...
 

Similar threads

Replies
1
Views
2K
Replies
2
Views
3K
Replies
1
Views
5K
Replies
5
Views
5K
Replies
1
Views
2K
Replies
0
Views
369
Replies
2
Views
2K
Replies
1
Views
7K
Back
Top