[Mathematica] Combining several Graphics in a Graphics3D

In summary, the conversation discusses the goal of plotting a 3D function using the Plot3D[] function in Mathematica. One method suggested is to create a table of Plot[] for different values of the x variable. Another method mentioned is using the StackGraphics[] command in the Graphics3D package, which can combine multiple plots into one 3D graph. However, this command has limited options. An alternative solution is using David Park's package, but it may no longer be free.
  • #1
guerom00
93
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
  • #2
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.
 
  • #3
Thanks for your answer. StackGraphics[] does work and does what I want although it lacks basic options...
 

Related to [Mathematica] Combining several Graphics in a Graphics3D

1. How do I combine multiple 2D graphics into a 3D plot in Mathematica?

To combine multiple 2D graphics into a 3D plot in Mathematica, you can use the function Graphics3D[] and specify each 2D graphic as an argument. For example, Graphics3D[{Circle[], Rectangle[]}] would combine a circle and a rectangle into a 3D plot.

2. Can I add labels or annotations to my combined 3D plot in Mathematica?

Yes, you can add labels and annotations to your combined 3D plot in Mathematica by using the function Text[] or Inset[]. These functions allow you to add text or graphics to a specific location in the plot.

3. How can I change the color and style of each individual 2D graphic in my combined 3D plot?

To change the color and style of each individual 2D graphic in your combined 3D plot, you can use the option PlotStyle within each 2D graphic's argument. This allows you to specify a different color or style for each graphic.

4. Is it possible to combine 3D plots with different coordinate systems in Mathematica?

Yes, you can combine 3D plots with different coordinate systems in Mathematica by using the function Show[]. This function allows you to combine multiple plots, even if they have different coordinate systems.

5. How can I adjust the positioning and orientation of my combined 3D plot in Mathematica?

To adjust the positioning and orientation of your combined 3D plot in Mathematica, you can use the options ViewPoint, ViewVertical, and ViewAngle within the Graphics3D[] function. These options allow you to change the viewpoint and orientation of the plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
948
Replies
5
Views
885
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top