Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: wrap a density plot on a sphere
Replies: 1   Last Post: Nov 11, 2013 11:29 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Bob Hanlon

Posts: 890
Registered: 10/29/11
Re: wrap a density plot on a sphere
Posted: Nov 11, 2013 11:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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
>
>






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.