Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: ListSphericalDensityPlot[] ??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64546] Re: ListSphericalDensityPlot[] ??
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 22 Feb 2006 05:58:29 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <dte2gk$rjm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

make a Graphics[] object out of your density plot 
and
than transform the polygons, i.e,
gr = DensityPlot[
       Re[SphericalHarmonicY[4, 2, th, phi]], {th, 
0, Pi}, {phi, 0, 2Pi},
       PlotPoints -> {64, 128}] // Graphics;

gg = gr /. Raster[bm_, {{x1_, y1_}, {x2_, y2_}}, 
{z1_, z2_}, ___] :>
             Block[{n, m, dx, dy, poly},
               {n, m} = Dimensions[bm];
               dx = (x2 - x1)/m; dy = (y2 - y1)/n;
               poly[{j_, i_}] := Block[{p}, p = 
{x1, y1} + {dx, dy}*{i - 1, j - 1};
               Polygon[{p, p + {dx, 0}, p + {dx, 
dy}, p + {0, dy}}]];
               MapIndexed[{GrayLevel[(#1 - 
z1)/(z2 - z1)], poly[#2]} &, bm, {2}]
             ];

Show[Graphics3D[{EdgeForm[],
  gg[[1]]} /. {(h : (Polygon | Line))[pnts_] :>
  Polygon[{Cos[#[[2]]]*Sin[#[[1]]], 
Sin[#[[2]]]*Sin[#[[1]]],
    Cos[#[[1]]]} & /@ pnts],
    GrayLevel[g_] :> SurfaceColor[Hue[g]]}
  ]
];

Regards

  Jens


"Bob Buchanan" <Bob.Buchanan at millersville.edu> 
schrieb im Newsbeitrag 
news:dte2gk$rjm$1 at smc.vnet.net...
| Hello,
|
| I have numerically approximated the omega-limit 
set of a model of a spherical, magnetic pendulum. 
For a grid of theta and phi coordinates on the 
unit sphere I have numerically solved the 
Hamiltonian system of ODEs governing the pendulum 
until it comes to rest (or pretty close to rest). 
The data is in the form of a rectangular array 
which I can easily display as a rectangular list 
density plot.
|
| Is there a way to wrap this density plot back 
around the surface of the unit sphere ---  
something like a ListSphericalDensityPlot[] 
function?
|
| I don't think there is an already defined 
function to perform this type of operation. Is 
there an easy way to do it myself?
|
| Thanks for any suggestions.
|
| Bob Buchanan
| Bob.Buchanan at millersville.edu
| 



  • Prev by Date: Surface graphing question
  • Next by Date: Re: question about Split[...]
  • Previous by thread: ListSphericalDensityPlot[] ??
  • Next by thread: Re: Re: ListSphericalDensityPlot[] ??