Re: plot data points onto sphere
- To: mathgroup at smc.vnet.net
- Subject: [mg48030] Re: plot data points onto sphere
- From: Sampo Smolander <sampo.smolander+newsnspam at helsinki.fi>
- Date: Sat, 8 May 2004 01:23:35 -0400 (EDT)
- Organization: University of Helsinki
- References: <c7fi6d$od7$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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