Mathematica Question: Wrapping Density Plot on Sphere

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 6K views
dewood88
Messages
1
Reaction score
0
I am new to Mathematica and I am trying to make models of white dwarf spherical harmonics similar to the ones on this site: http://whitedwarf.org/education/vis/index.html. So far the closest thing I have is this:

SphericalPlot3D[3, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
Mesh -> None,
ColorFunction ->
Function[{x, y, z, \[Theta], \[Phi], r},
Evaluate[
Hue@Rescale[
Arg@Re[SphericalHarmonicY[3,
1, \[Theta], \[Phi]]], {-\[Pi], \[Pi]}]]],
ColorFunctionScaling -> False, PlotPoints -> 35]

However, the color scaling does not allow a blending of the two colors, so instead I would like to wrap a density plot like this one:

Manipulate[
DensityPlot[
Re[SphericalHarmonicY[l, m, \[Theta], \[Phi]]], {\[Theta],
0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
FrameLabel -> {\[Theta], \[Phi]}], {l, 1, 10, 1}, {m, 0, 10, 1}]

over a sphere of radius 3 and be able to control the l and m values with sliders ("Manipulate"). Does anyone know a simple way to do this? Any helpful hints would be greatly appreciated! :)
 
Physics news on Phys.org
You might want to shift this post to 'programming' section. May get more responses there