Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16212

Re: wrap a density plot on a sphere

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: wrap a density plot on a sphere
Date 2013-11-12 04:29 +0000
Message-ID <l5sarm$dmn$1@smc.vnet.net> (permalink)
References <20131111050532.DBDCD6A22@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Did you create an interpolation function from your data?


data = Flatten[Table[{t, p, Sqrt[p^2 + t^2]},
    {t, 0, 2 Pi, Pi/16}, {p, 0, Pi, Pi/32}], 1];


f = Interpolation[data];


SphericalPlot3D[1,
 {t, 0, 2 Pi}, {p, 0, Pi},
 ColorFunction ->
  Function[{x, y, z, t, p, r}, Hue[f[t, p]]],
 Mesh -> 10,
 MeshFunctions ->
  {Function[{x, y, z, t, p, r}, f[t, p]]}]


Comparing with the original function


SphericalPlot3D[1,
 {t, 0, 2 Pi}, {p, 0, Pi},
 ColorFunction ->
  Function[{x, y, z, t, p, r}, Hue[Sqrt[p^2 + t^2]]],
 Mesh -> 10,
 MeshFunctions ->
  {Function[{x, y, z, t, p, r}, Sqrt[p^2 + t^2]]}]



Bob Hanlon




On Mon, Nov 11, 2013 at 12:05 AM, Danny Barker <danny.barkan@gmail.com>wrote:

> Dear all
>
> I have a data set in the form of a list: {
> {Theta1,Phi1,f1},{Theta2,Phi2,f2}, ... } which i would like to present as a
> density/Contour plot on the surface of a sphere
>
> i read past posts and tried using
>
> SphericalPlot3D[1, {t, 0, 2 Pi}, {p, 0, Pi},
>  ColorFunction -> Function[{x, y, z, t, p, r}, Hue[f[t, p]]],
>  Mesh -> 10, MeshFunctions -> {Function[{x, y, z, t, p, r}, f[t, p]]}]
>
> but can't seem to get it right...
>
> thanks in advance for your help
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: wrap a density plot on a sphere Bob Hanlon <hanlonr357@gmail.com> - 2013-11-12 04:29 +0000

csiph-web