MathGroup Archive 2004

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

Search the Archive

Re: plot data points onto sphere

  • To: mathgroup at
  • Subject: [mg48030] Re: plot data points onto sphere
  • From: Sampo Smolander <sampo.smolander+newsnspam at>
  • Date: Sat, 8 May 2004 01:23:35 -0400 (EDT)
  • Organization: University of Helsinki
  • References: <c7fi6d$od7$>
  • Sender: owner-wri-mathgroup at

Michael <michael.john at> 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:

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