MathGroup Archive 1997

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

Search the Archive

Plotting a 3D Cloud of Points


David E. Burmaster inquired about plotting a cloud of points, in
3D space, with each point also being projected onto the x=0, y=0,
and z=0 planes.

Robert Hohlfelder replied with a solution as follows:

myListPlot3D[pointList_,options___]:=
Show[Graphics3D[pointList/.{a_,b_,c_}->Point[{a,b,c}],
options]];

data={{0.5,0.57,0.79},etc (your x,y,z data)};
data2=Join[
   data,
   (data/.{x_,y_,z_}->{x,y,0}),
   (data/.{x_,y_,z_}->{x,0,z}),
   (data/.{x_,y_,z_}->{0,y,z})
]

myListPlot3D[data2,Axes->Ture]


May I suggest the "joining" routine be replaced with:

data2=Join[
   data,
   Map[(#/.{x_,y_,z_}->{x,y,0})&,data],
   Map[(#/.{x_,y_,z_}->{x,0,z})&,data],
   Map[(#/.{x_,y_,z_}->{0,y,z})&,data]
]

Otherwise the points are replaced with {0}, not with {x,y,0},
etc.

Additionally, you could separate the data into four lists, and
use ListPlot3D directly, and change the lighting for each of the
lists, so the points would be color-coded on the graph.

Hope this info is of use
John C. Erb



  • Prev by Date: Re: Mac AppleEvents and the 3.0 front end
  • Next by Date: Re: Generating lists of normally-distributed numbers?
  • Previous by thread: plotting a 3D cloud of points
  • Next by thread: Re: Information about non-symbol heads