       Re: 2-d graphs to 3-d

• To: mathgroup at smc.vnet.net
• Subject: [mg2514] Re: 2-d graphs to 3-d
• From: ianc (Ian Collier)
• Date: Wed, 15 Nov 1995 02:01:32 -0500
• Organization: Wolfram Research, Inc.

```In article <DHv1wz.B2w at wri.com>, Mark Schunder <mschunde at umich.edu> wrote:

> Maybe you can help me out.  I have a Mathematica question for
> you.  I have generated 300 2-D graphs.  Each of these graphs is
> made up of 256 different colors (not all of them have 256
> colors though).  Is there a way to create a 3-D graph out of
> these by stacking them on top of each other?  And possibly only
> showing a certain color?   For instance I would like to 'graph'
> wherever the color .3,.2,.1 shows up (in RGB) in 3-D.  I
> s this possible with Mathematica?
>
> Thanks

If I have understood y correctly you can do this using
ParametricPlot3D. ParametricPlot3D allows you to plot
multiple objects. It also allows you to plot lines in
space, you just have to set either x or y to be constant.
Finally you can use a 4th parameter for the colour of each
object.

Here is a simple example:

In:=
expr1 = Sin[x]/x;

In:=
Plot[ expr1, {x, -10,10} ]
Out=
-Graphics-

In:=
expr2 = Cos[x]/x;

In:=
Plot[ expr2, {x, -10,10} ]
Out=
-Graphics-

In:=
expr3 = Cos[x];

In:=
Plot[ Cos[x], {x, -10,10}]
Out=
-Graphics-

In:=
?ParametricPlot3D

ParametricPlot3D[{fx, fy, fz}, {t, tmin, tmax}] produces a
three-dimensional space curve parameterized by a variable
t which runs from tmin to tmax. ParametricPlot3D[{fx, fy,
fz}, {t, tmin, tmax}, {u, umin, umax}] produces a
three-dimensional surface parametrized by t and u.
ParametricPlot3D[{fx, fy, fz, s}, ...] shades the plot
according to the color specification s.
ParametricPlot3D[{{fx, fy, fz}, {gx, gy, gz}, ...}, ...]
plots several objects together.

In:=
Needs[ "Graphics`Colors`"]

In:=
ParametricPlot3D[ {{x,1, expr1, Red},
{x, 2, expr2, Green},
{x, 3,expr3, Blue}},
{x, -10,10}, BoxRatios -> {3,1,1}]

Out=
-Graphics3D-

I hope this helps.

--Ian

-----------------------------------------------------------
Ian Collier
Technical Sales Support
Wolfram Research, Inc.
-----------------------------------------------------------
tel:(217)-398-0700     fax:(217)-398-0747      ianc at wri.com