MathGroup Archive 2004

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

Search the Archive

Re: plot data points onto sphere


Michael <michael.john at ch.tum.de> wrote:
> Hi, I would like to plot data points (theta, phi) from a list onto the
> surface of a sphere, generated with SphericalPlot3D. Does anyone know
> how to do that with mathematica? There was a related entry from Peter
> Lundberg, yet without response.

This is a primitive way:

Needs["Graphics`ParametricPlot3D"]
pic1 = SphericalPlot3D[1, {theta, 0, Pi}, {phi, 0, 2Pi}]
data = Table[{ArcCos[Random[]*2 - 1], Random[]*2*Pi}, {100}];
fun1[{theta_, phi_}] := {Sin[theta]Cos[phi],Sin[theta]Sin[phi],Cos[theta]}
pic2 = Graphics3D[{PointSize[0.05], Map[Point[fun1[#]]&, data]}]
Show[pic1, pic2]

You may get some funny graphical artefacts because of the way the
points and the polygons of the sphere inter(lace?,vene?).
Ways to avoid that would make another story.

-- 
Sampo Smolander


  • Prev by Date: Re: plot data points onto sphere
  • Next by Date: Re: Building List
  • Previous by thread: Re: plot data points onto sphere
  • Next by thread: Simple question