MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: 2-d graphs to 3-d

  • To: mathgroup at
  • 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>, Mark Schunder <mschunde at> 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 

Here is a simple example:

    expr1 = Sin[x]/x;

    Plot[ expr1, {x, -10,10} ]

    expr2 = Cos[x]/x;

    Plot[ expr2, {x, -10,10} ]

    expr3 = Cos[x];

    Plot[ Cos[x], {x, -10,10}]


    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.

    Needs[ "Graphics`Colors`"]

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


I hope this helps.


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

  • Prev by Date: Limitations of NDSolve
  • Next by Date: Re: Methods of solving nonlinear equation
  • Previous by thread: Re: 2-d graphs to 3-d
  • Next by thread: ListPlot[<list>, PlotJoined->True], but _with_ symbols?